#include "includes_fw.h"
#include "lib_retina.h"
#include "mmpf_usbvend.h"
#include "mmpf_usbdescr.h"

#include "config_fw.h"
#include "mmpf_usbuvc.h"
/** @addtogroup MMPF_USB
@{
*/

#if defined(USB_FW)||(USB_EN)

#pragma O0


#define AUDIO_PACKET_SIZE(samprate,sampchannel) \
    ( 512 ) & 0xFF , \
    ( 512 ) >> 8  

#define UUID(L1,S1,S2,D1,D2) \
LESBYTE(L1),\
LOSBYTE(L1),\
HISBYTE(L1),\
MSSBYTE(L1),\
LOBYTE(S1),\
HIBYTE(S1),\
LOBYTE(S2),\
HIBYTE(S2),\
MSSBYTE(D1),\
HISBYTE(D1),\
LOSBYTE(D1),\
LESBYTE(D1),\
MSSBYTE(D2),\
HISBYTE(D2),\
LOSBYTE(D2),\
LESBYTE(D2)

//make the number into to bytes in little endianess
#define WORD_LE(num) LOBYTE(num), HIBYTE(num)

//make the resolution into to bytes in little endianess
#define RES_LE(w,h) WORD_LE(w), WORD_LE(h)

#define YUY2_FORMAT_DESC(index,num) \
USB_UVC_YUV_FORMAT_DESC_SIZE,\
0x024,\
0x004,\
index,\
num,\
0x059,\
0x055,\
0x059,\
0x032,\
0x000,\
0x000,\
0x010,\
0x000,\
0x080,\
0x000,\
0x000,\
0x0AA,\
0x000,\
0x038,\
0x09B,\
0x071,\
0x010,\
0x001,\
0x000,\
0x000,\
0x000,\
0x000,

#define YUY2_FRAME_DESC(num,w,h,fps) \
USB_UVC_YUV_FRAME_DESC_SIZE,\
0x024,\
0x005,\
num,\
0x000,\
LOBYTE(w),\
HIBYTE(w),\
LOBYTE(h),\
HIBYTE(h),\
LESBYTE(w*h*2*8*fps),\
LOSBYTE(w*h*2*8*fps),\
HISBYTE(w*h*2*8*fps),\
MSSBYTE(w*h*2*8*fps),\
LESBYTE(w*h*2*8*fps),\
LOSBYTE(w*h*2*8*fps),\
HISBYTE(w*h*2*8*fps),\
MSSBYTE(w*h*2*8*fps),\
LESBYTE(w*h*2),\
LOSBYTE(w*h*2),\
HISBYTE(w*h*2),\
MSSBYTE(w*h*2),\
LESBYTE(10000000/fps),\
LOSBYTE(10000000/fps),\
HISBYTE(10000000/fps),\
MSSBYTE(10000000/fps),\
0x001,\
LESBYTE(10000000/fps),\
LOSBYTE(10000000/fps),\
HISBYTE(10000000/fps),\
MSSBYTE(10000000/fps),

#define YUY2_STILL_DESC(len,num,...) \
len,\
0x024,\
0x003,\
0x000,\
num,\
__VA_ARGS__,\
0x001,\
0x003,

#define MJPEG_FORMAT_DESC(index,num) \
0x00B,\
0x024,\
0x006,\
index,\
num,\
0x000,\
0x001,\
0x000,\
0x000,\
0x000,\
0x000,

#define MJPEG_FRAME_DESC(num,w,h,size,fps) \
0x01E,\
0x024,\
0x007,\
num,\
0x000,\
LOBYTE(w),\
HIBYTE(w),\
LOBYTE(h),\
HIBYTE(h),\
LESBYTE(0x3C00*8*fps),\
LOSBYTE(0x3C00*8*fps),\
HISBYTE(0x3C00*8*fps),\
MSSBYTE(0x3C00*8*fps),\
LESBYTE(0x60000*8*fps),\
LOSBYTE(0x60000*8*fps),\
HISBYTE(0x60000*8*fps),\
MSSBYTE(0x60000*8*fps),\
LESBYTE(size),\
LOSBYTE(size),\
HISBYTE(size),\
MSSBYTE(size),\
LESBYTE(10000000/fps),\
LOSBYTE(10000000/fps),\
HISBYTE(10000000/fps),\
MSSBYTE(10000000/fps),\
0x001,\
LESBYTE(10000000/fps),\
LOSBYTE(10000000/fps),\
HISBYTE(10000000/fps),\
MSSBYTE(10000000/fps),

#define MJPEG_STILL_DESC(len,num,...) \
len,\
0x024,\
0x003,\
0x000,\
num,\
__VA_ARGS__,\
0x001,\
0x003,

#define H264_FORMAT_DESC(index,num) \
USB_UVC_H264_FORMAT_DESC_SIZE,\
0x024,\
0x10,\
index,\
num,\
0x048,\
0x032,\
0x036,\
0x034,\
0x000,\
0x000,\
0x010,\
0x000,\
0x080,\
0x000,\
0x000,\
0x0AA,\
0x000,\
0x038,\
0x09B,\
0x071,\
0x010,\
0x001,\
0x000,\
0x000,\
0x000,\
0x000,\
0x001,

#define H264_FRAME_DESC(num,w,h,fps) \
USB_UVC_H264_FRAME_DESC_SIZE,\
0x024,\
0x011,\
num,\
0x000,\
LOBYTE(w),\
HIBYTE(w),\
LOBYTE(h),\
HIBYTE(h),\
LESBYTE(0x80000*8*fps),\
LOSBYTE(0x80000*8*fps),\
HISBYTE(0x80000*8*fps),\
MSSBYTE(0x80000*8*fps),\
LESBYTE(0x100000*8*fps),\
LOSBYTE(0x100000*8*fps),\
HISBYTE(0x100000*8*fps),\
MSSBYTE(0x100000*8*fps),\
LESBYTE(10000000/fps),\
LOSBYTE(10000000/fps),\
HISBYTE(10000000/fps),\
MSSBYTE(10000000/fps),\
0x003,\
0x000,\
0x000,\
0x000,\
0x000,\
LESBYTE(10000000/fps),\
LOSBYTE(10000000/fps),\
HISBYTE(10000000/fps),\
MSSBYTE(10000000/fps),\
LESBYTE(12500000/fps),\
LOSBYTE(12500000/fps),\
HISBYTE(12500000/fps),\
MSSBYTE(12500000/fps),\
0x020,\
0x0A1,\
0x007,\
0x000,

#define H264_STILL_DESC(len,num,...) \
len,\
0x024,\
0x003,\
0x000,\
num,\
__VA_ARGS__,\
0x001,\
0x003,

#define COLOR_DESC(color,gamma,matrix) \
USB_UVC_COLOR_DESC_SIZE,\
0x024,\
0x00D,\
color,\
gamma,\
matrix,

#define VC_OT_DESC(id,srcid) \
USB_UVC_IF_CTL_OT_DESC_SIZE,\
0x024,\
0x003,\
id,\
0x001,\
0x001,\
0x000,\
srcid,\
0x000,

#define VC_PU_DESC(id,srcid,bitmap) \
USB_UVC_IF_CTL_PU_DESC_SIZE,\
0x024,\
0x005,\
id,\
srcid,\
0x000,\
0x000,\
0x002,\
LOBYTE(bitmap),\
HIBYTE(bitmap),\
0x000,

#define VC_IT_DESC(id,bitmap) \
USB_UVC_IF_CTL_IT_DESC_SIZE,\
0x024,\
0x002,\
id,\
0x001,\
0x002,\
0x000,\
0x000,\
0x000,\
0x000,\
0x000,\
0x000,\
0x000,\
0x000,\
0x003,\
LESBYTE(bitmap),\
LOSBYTE(bitmap),\
HISBYTE(bitmap),

#define VC_XU_DESC(id,srcid,uuid,cn,bitmap) \
USB_UVC_IF_CTL_XU_DESC_SIZE,\
0x024,\
0x006,\
id,\
uuid,\
cn,\
0x001,\
srcid,\
0x002,\
LOBYTE(bitmap),\
HIBYTE(bitmap),\
0x000,

#if (SECS_VER > 0)
// for new Skype UVC 2.1
#define VC_SKYPE_XU_DESC(id,srcid,uuid,cn,bitmap) \
USB_UVC_IF_CTL_SECS_XU_DESC_SIZE,\
0x024,\
0x006,\
id,\
uuid,\
cn,\
0x001,\
srcid,\
0x004,\
LESBYTE(bitmap),\
LOSBYTE(bitmap),\
HISBYTE(bitmap),\
MSSBYTE(bitmap),\
0x000,
#endif
#if (CUSTOMER == ASU)
//{F5208B72-A37A-457E-A309-AE3060780E21} for Asus
//XU tool format:72 8B 20 F5  7A A3  7E 45 A3 09 AE 30 60 78 0E 21
//#define UVC_EU2_GUID    UUID(0xF5208B72,0xA37A,0x457E,0xA309AE30,0x60780E21)
#define UVC_EU2_GUID    UUID(0x4902BC7C,0x7096,0x49EF,0x891CD01E,0x7618A2FD)//ASU new GUID by william_chou@asus.com 2012/11/20 12:54
#else
#define UVC_EU2_GUID    UUID(0x2C49D16A,0x32B8,0x4485,0x3EA8643A,0x152362F2)
#endif

#define UVC_EU1_GUID    UUID(0x23E49ED0,0x1178,0x4f31,0xAE52D2FB,0x8A8D3B48)

#if (SECS_VER > 0)
// {B42153BD-35D6-45CA-B203-4E0149B301BC} for Skype API
//#define UVC_EU0_GUID    UUID(0xB42153BD,0x35D6,0x45CA,0xB2034E01,0x49B301BC)
#define UVC_EU0_GUID    UUID(0xBD5321B4,0xD635,0xCA45,0xB2034E01,0x49B301BC)  // for new Skype UVC 2.1
#endif

#if SKYPE_UVC_H264
// {A29E7641-DE04-47E3-8B2B-F4341AFF003B} for USBIF UVC 1.1 for H.264 Payload
#define UVC_EU3_GUID    UUID(0xA29E7641,0xDE04,0x47E3,0x8B2BF434,0x1AFF003B)
#endif

#define UAC_PCM_FORMAT_DESC(len,ch,w,bit,num,...) \
len,\
0x024,\
0x002,\
0x001,\
ch,\
w,\
bit,\
num,\
__VA_ARGS__,


//#if (SUPPORT_UVC_FUNC==1)
MMP_UBYTE   DEVICE_QUALIFIER_DESCRIPTOR_DATA1[0x0A] =
{
// device qualifier descriptor
0x00a,
0x006,
0x000,
0x002,
0x0EF,
0x002,
0x001,
0x040,
0x001,
0x000,
};                    

MMP_UBYTE   DEVICE_DESCRIPTOR_DATA1[0x12] =
{
// device descriptor
0x012,
0x001,
0x000,
0x002,
0x0EF,
0x002,
0x001,
0x040,

LOBYTE(VENDOR_ID),
HIBYTE(VENDOR_ID),
LOBYTE(PID),
HIBYTE(PID),

LOBYTE(FW_VER_BCD), //0x000,
HIBYTE(FW_VER_BCD), //0x001,
0x001,
0x000,//move product name to IAD
#if (CUSTOMER == LIT)
0x003,
#else
0x000,
#endif
0x001
};

#if (SUPPORT_SWITCH_CAMERA)
MMP_UBYTE   HS_CONFIG_DESCRIPTOR_DATA1[CAMERA_1_CONFIG_DESCRIPTOR_LEN] =
#else
MMP_UBYTE   HS_CONFIG_DESCRIPTOR_DATA1[CONFIG_DESCRIPTOR_LEN] =//+0x6B
#endif
{
// configuration descriptor
USB_CFG_DESC_SIZE,
0x002,
#if (SUPPORT_SWITCH_CAMERA)
LOBYTE(CAMERA_1_CONFIG_DESCRIPTOR_LEN),      
HIBYTE(CAMERA_1_CONFIG_DESCRIPTOR_LEN),      
NUM_OF_CONFIG_1_TOTAL_IF,// num of interface
#else
LOBYTE(CONFIG_DESCRIPTOR_LEN),      
HIBYTE(CONFIG_DESCRIPTOR_LEN),      
NUM_OF_TOTAL_IF,// num of interface
#endif

0x001,
0x000,
0x080,
0x0FA,                    

// *******************************************************
// Interface Association Descriptor
USB_IF_ASC_DESC_SIZE,
0x00B,
UVC_D1_CTL_IF_NO,// first interface
NUM_OF_UVC_D1_IF,// num of interface
0x00E,// class:video class
0x003,// sub-class:video interface collection 
0x000,
0x002,//device 1 product name
// *******************************************************
// Interface Descriptor
USB_IF_UVC_CTL_DESC_SIZE,
0x004,
UVC_D1_CTL_IF_NO,// interface
0x000,// alt.
0x001,//number of endpoints in this interface
0x00E,// class:video class
SC_VIDEOCONTROL, //0x001,// sub-class:video control
0x000,
0x002,//device 1 product name

// VC Interface Descriptor
USB_UVC_IF_CTL_HEADER_DESC_SIZE,
CS_INTERFACE,//0x024,
VC_HEADER,//0x001,// Header
0x000,// UVC Version 1.0 ( xp not support ver 1.1 )
0x001,
USB_UVC_IF_CTL_TOTAL_SIZE,
0x00,
LESBYTE(300000*1000),// sys clock - 300MHZ
LOSBYTE(300000*1000),
HISBYTE(300000*1000),
MSSBYTE(300000*1000),
NUM_OF_UVC_D1_STREAM_IF,// num of video stream
UVC_D1_STREAM_IF1_NO,// interface of video stream
//reserved for video stream 2


#if SKYPE_UVC_H264
// Interface Output Terminal Descriptor
VC_OT_DESC(UVC_OT_ID, UVC_EU3_ID)  // TID = 0x04, src ID = 0x02

// {A29E7641-DE04-47E3-8B2B-F4341AFF003B} for USBIF UVC 1.1 for H.264 Payload
VC_XU_DESC(UVC_EU3_ID, UVC_EU2_ID, UVC_EU3_GUID, 0x0B, 0x7F07)
#else
// Interface Output Terminal Descriptor
VC_OT_DESC(UVC_OT_ID, UVC_EU2_ID)  // TID = 0x04, src ID = 0x02
#endif

// Interface Extension Unit Descriptor
// {2C49D16A-32B8-4485-3EA8-643A152362F2} for LGT
#if (CUSTOMER == ASU)
//VC_XU_DESC(UVC_EU2_ID, UVC_EU1_ID, UVC_EU2_GUID, 0x05, 0x001F)
VC_XU_DESC(UVC_EU2_ID, UVC_EU1_ID, UVC_EU2_GUID, 0x01, 0x0001)
#else
VC_XU_DESC(UVC_EU2_ID, UVC_EU1_ID, UVC_EU2_GUID, 0x06, 0x003F)
#endif


// Interface Extension Unit Descriptor
// {23E49ED0-1178-4f31-AE52-D2FB8A8D3B48} for AIT XU
#if (CUSTOMER == CCN) || (CUSTOMER == LON) || (CUSTOMER == ASU)
    #if SECS_VER > 0
    VC_XU_DESC(UVC_EU1_ID, UVC_EU0_ID, UVC_EU1_GUID, 0x05, 0xEFFF)
    #else
    VC_XU_DESC(UVC_EU1_ID, UVC_PU_ID, UVC_EU1_GUID, 0x05, 0xEFFF)
    #endif
#else
    #if SECS_VER > 0
    VC_XU_DESC(UVC_EU1_ID, UVC_EU0_ID, UVC_EU1_GUID, 0x05, 0x6FFF)
    #else
    VC_XU_DESC(UVC_EU1_ID, UVC_PU_ID, UVC_EU1_GUID, 0x05, 0x6FFF)
    #endif
#endif

#if (SECS_VER > 0)
// Interface Extension Unit Descriptor
// {B42153BD-35D6-45CA-B203-4E0149B301BC} for Skype API
VC_SKYPE_XU_DESC(UVC_EU0_ID, UVC_PU_ID, UVC_EU0_GUID, 0x20, 0x03803F9F)
#endif

// Interface Input(Camera) Terminal Descriptor
VC_IT_DESC(UVC_IT_ID,UVC_D1_IT_BITMAP)

// Interface Processing Unit Descriptor
VC_PU_DESC(UVC_PU_ID,UVC_IT_ID,UVC_D1_PU_BITMAP)

// Endpoint Descriptor
USB_EP_DESC_SIZE,
0x005,
(0x80|PCCAM_EX_EP_ADDR),// EP3
0x003,// INT
EX_EP_MAX_PK_SIZE,//0x008,// size
0x000,
0x008,//0x004,// interval

// Endpoint Interrupt Descriptor
USB_UVC_EP_INT_DESC_SIZE,
0x025,
0x003,// interrupt
EX_EP_MAX_PK_SIZE,//0x008,// size
0x000,

// *******************************************************
// Interface Descriptor
USB_IF_UVC_STREAM_DESC_SIZE,
0x004,
UVC_D1_STREAM_IF1_NO,// interface
0x000,// alt.
#if USB_UVC_BULK_EP
0x001,// eps
#else
0x000,// eps
#endif
0x00E,// class:video class
SC_VIDEOSTREAMING,// sub-class:video streaming
0x000,
0x000,

// Interface Input Header Descriptor
0x00D
#if ENABLE_YUY2
+0x01
#endif
#ifdef ENABLE_UYVY
+0x01
#endif
#ifdef ENABLE_NV12
+0x01
#endif
#if ENABLE_MJPEG
+0x01
#endif
#if ENABLE_FRAME_BASE_H264 // FrameBaseH264
+0x01
#endif
#ifdef ENABLE_FRAME_BASE_AVC1
+0x01
#endif
,
CS_INTERFACE,//0x024,
VS_INPUT_HEADER,//0x001,// Input Header
#if ENABLE_YUY2
0x001 //total format
#else
0x000
#endif
#ifdef ENABLE_UYVY
+0x01
#endif
#ifdef ENABLE_NV12
+0x01
#endif
#if ENABLE_MJPEG
+0x01
#endif
#if ENABLE_FRAME_BASE_H264 // FrameBaseH264
+0x01
#endif
#ifdef ENABLE_FRAME_BASE_AVC1
+0x01
#endif
,

LOBYTE(UVC_D1_INPUT_HEADER_LENGTH),      
HIBYTE(UVC_D1_INPUT_HEADER_LENGTH),      
(0x080|PCCAM_TX1_EP_ADDR),// video endpoint
0x000,
UVC_OT_ID, //0x004,//0x003,// linkID
#if USING_STILL_METHOD_1
0x000,//0x002, //0x001,//still method 1 //0x002,// still method 2
#else
0x002,//0x002, //0x001,//still method 1 //0x002,// still method 2
#endif
0x001,// Hardware still trigger support, 0: Not supported, 1: Supported
0x000,// Trigger usage, 0:Initiate still image capture, 1: General purpose button event
0x001,// bControlSize, size of each bmaControls(x) field, in bytes
#if ENABLE_YUY2
0x000,
#endif
#ifdef ENABLE_UYVY
0x000,
#endif
#ifdef ENABLE_NV12
0x000,
#endif
#if ENABLE_MJPEG
0x000,
#endif
#if ENABLE_FRAME_BASE_H264 
0x000,
#endif
#ifdef ENABLE_FRAME_BASE_AVC1
0x000,
#endif

#if (SWAP_VIDEO_FORMAT_INDEX == 0)  // YUY2 index is 1, MJPEG index is 2

#if ENABLE_YUY2
// Interface Format Uncompressed Descriptor
// 32595559-0000-0010-8000-00AA00389B71  'YUY2' == MEDIASUBTYPE_YUY2
YUY2_FORMAT_DESC(YUY2_FORMAT_INDEX, NUM_D1_YUY2_VIDEO)
#if (CUSTOMER == ASU)
// Interface Frame Uncompressed Descriptor ( 640x480 30fps )
YUY2_FRAME_DESC(0x01, 640, 480, 30)

#elif (CUSTOMER == QDR)
// Interface Frame Uncompressed Descriptor ( 640x480 30fps )
YUY2_FRAME_DESC(0x01, 640, 480, 30)

// Interface Frame Uncompressed Descriptor ( 160x120 30fps )
YUY2_FRAME_DESC(0x02, 160, 120, 30)

// Interface Frame Uncompressed Descriptor ( 320x240 30fps )
YUY2_FRAME_DESC(0x03, 320, 240, 30)

// Interface Frame Uncompressed Descriptor ( 640x360 30fps )
YUY2_FRAME_DESC(0x04, 640, 360, 30)
#if NUM_D1_YUY2_VIDEO > 6
// Interface Frame Uncompressed Descriptor ( 1280x720 30fps )
YUY2_FRAME_DESC(0x05, 1280, 720, 30)

// Interface Frame Uncompressed Descriptor ( 960x720 30fps )
YUY2_FRAME_DESC(0x06, 960, 720, 30)

// Interface Frame Uncompressed Descriptor ( 800x600 30fps )
YUY2_FRAME_DESC(0x07, 800, 600, 30)

// Interface Frame Uncompressed Descriptor ( 160x90 30fps )
YUY2_FRAME_DESC(0x08, 160, 90, 30)

// Interface Frame Uncompressed Descriptor ( 320x180 30fps )
YUY2_FRAME_DESC(0x09, 320, 180, 30)
#endif

#else
// Interface Frame Uncompressed Descriptor ( 640x480 15fps )
YUY2_FRAME_DESC(0x01, 160, 120, 25)
YUY2_FRAME_DESC(0x02, 160, 120, 25)
YUY2_FRAME_DESC(0x03, 160, 120, 25)
YUY2_FRAME_DESC(0x04, 160, 120, 25)

//YUY2_FRAME_DESC(0x01, 640, 480, 15)
//YUY2_FRAME_DESC(0x02, 160, 120, 15)
//YUY2_FRAME_DESC(0x03, 128, 128, 15)
//YUY2_FRAME_DESC(0x04,  64,  64, 15)
/*
// Interface Frame Uncompressed Descriptor ( 160x120 30fps )
YUY2_FRAME_DESC(0x02, 160, 120, 30)

// Interface Frame Uncompressed Descriptor ( 320x240 30fps )
YUY2_FRAME_DESC(0x03, 320, 240, 30)

// Interface Frame Uncompressed Descriptor ( 640x360 30fps )
YUY2_FRAME_DESC(0x04, 640, 360, 30)

// Interface Frame Uncompressed Descriptor ( 384x216 30fps )
YUY2_FRAME_DESC(0x05, 384, 216, 30)

// Interface Frame Uncompressed Descriptor ( 352x288 30fps )
YUY2_FRAME_DESC(0x06, 352, 288, 30)
*/
#if NUM_D1_YUY2_VIDEO > 6
// Interface Frame Uncompressed Descriptor ( 1280x720 30fps )
YUY2_FRAME_DESC(0x07, 1280, 720, 30)

// Interface Frame Uncompressed Descriptor ( 960x720 30fps )
YUY2_FRAME_DESC(0x08, 960, 720, 30)

// Interface Frame Uncompressed Descriptor ( 800x448 30fps )
YUY2_FRAME_DESC(0x09, 800, 448, 30)

// Interface Frame Uncompressed Descriptor ( 800x600 30fps )
YUY2_FRAME_DESC(0x0A, 800, 600, 30)

// Interface Frame Uncompressed Descriptor ( 160x90 30fps )
YUY2_FRAME_DESC(0x0B, 160, 90, 30)

// Interface Frame Uncompressed Descriptor ( 320x180 30fps )
YUY2_FRAME_DESC(0x0C, 320, 180, 30)
#endif
#if (SUPPORT_DUAL_DEVICE==0) && (SUPPORT_SWITCH_CAMERA==0)//not use for ASUS ov9726
#if (USB_UVC_1080P_YUY2_EN)
// Interface Frame Uncompressed Descriptor ( 1920x1080 30fps )
YUY2_FRAME_DESC(0x0D, 1920, 1080, 30)
#endif
#if (USB_UVC_5M_EN)
// Interface Frame Uncompressed Descriptor ( 1024x768 30fps )
YUY2_FRAME_DESC(0x0E, 1024, 768, 30)

// Interface Frame Uncompressed Descriptor ( 1600x1200 30fps )
YUY2_FRAME_DESC(0x0F, 1600, 1200, 30)

// Interface Frame Uncompressed Descriptor ( 2048x1536 30fps )
YUY2_FRAME_DESC(0x10, 2048, 1536, 30)

// Interface Frame Uncompressed Descriptor ( 2592x1944 30fps )
YUY2_FRAME_DESC(0x11, 2592, 1944, 30)
#endif
#endif
#endif//end of (CUSTOMER == ASU)

#if (USING_STILL_METHOD_1 == 0)
//Interface Still Image Frame Descriptor
#if NUM_YUY2_STILL == 3
YUY2_STILL_DESC(USB_UVC_YUY2_STILL_DESC_SIZE, NUM_YUY2_STILL, RES_LE(640,480), RES_LE(320,240), RES_LE(160,120))
#endif
#endif

// Interface Color Format
COLOR_DESC(1,1,4)

#endif	//ENABLE_YUY2

#endif  //  #if (SWAP_VIDEO_FORMAT_INDEX == 0)


// Interface Format MJPEG Descriptor
#if ENABLE_MJPEG

MJPEG_FORMAT_DESC(MJPEG_FORMAT_INDEX, NUM_D1_MJPG_VIDEO)
#if (CUSTOMER == ASU)
// Interface Frame MJPEG Descriptor ( 640x480 30fps )
MJPEG_FRAME_DESC(0x01, 640, 480, 0x100000, 30)

// Interface Frame MJPEG Descriptor ( 1280x720 30fps )
MJPEG_FRAME_DESC(0x02, 1280, 720, 0x100000, 30)

#elif (CUSTOMER == QDR)
#if BIND_SENSOR_AR0832E
// Interface Frame MJPEG Descriptor ( 640x480 30fps )
MJPEG_FRAME_DESC(0x01, 640, 480, 0x100000, 15)
// Interface Frame MJPEG Descriptor ( 1280x720 30fps )
MJPEG_FRAME_DESC(0x02, 1280, 720, 0x100000, 15)
// Interface Frame MJPEG Descriptor ( 1280x960 30fps )
MJPEG_FRAME_DESC(0x03, 1280, 960, 0x100000, 15)
// Interface Frame MJPEG Descriptor ( 1920x1080 30fps )
MJPEG_FRAME_DESC(0x04, 1920, 1080, 0x100000, 15)
// Interface Frame MJPEG Descriptor ( 2048x1536 15fps )
MJPEG_FRAME_DESC(0x05, 2048, 1536, 0x100000, 15)
// Interface Frame MJPEG Descriptor ( 2592x1944 15fps )
MJPEG_FRAME_DESC(0x06, 2592, 1944, 0x100000, 15)
#else
// Interface Frame MJPEG Descriptor ( 1280x720 30fps )
MJPEG_FRAME_DESC(0x01, 1280, 720, 0x100000, 30)

// Interface Frame MJPEG Descriptor ( 160x120 30fps )
MJPEG_FRAME_DESC(0x02, 160, 120, 0x100000, 30)

// Interface Frame MJPEG Descriptor ( 320x240 30fps )
MJPEG_FRAME_DESC(0x03, 320, 240, 0x100000, 30)

// Interface Frame MJPEG Descriptor ( 640x360 30fps )
MJPEG_FRAME_DESC(0x04, 640, 360, 0x100000, 30)

// Interface Frame MJPEG Descriptor ( 640x480 30fps )
MJPEG_FRAME_DESC(0x05, 640, 480, 0x100000, 30)

// Interface Frame MJPEG Descriptor ( 960x720 30fps )
MJPEG_FRAME_DESC(0x06, 960, 720, 0x100000, 30)

// Interface Frame MJPEG Descriptor ( 800x600 30fps )
MJPEG_FRAME_DESC(0x07, 800, 600, 0x100000, 30)

// Interface Frame MJPEG Descriptor ( 160x90 30fps )
MJPEG_FRAME_DESC(0x08, 160, 90, 0x100000, 30)

// Interface Frame MJPEG Descriptor ( 320x180 30fps )
MJPEG_FRAME_DESC(0x09, 320, 180, 0x100000, 30)

// Interface Frame MJPEG Descriptor ( 480x270 30fps )
MJPEG_FRAME_DESC(0x0A, 480, 270, 0x100000, 30)

// Interface Frame MJPEG Descriptor ( 800x450 30fps )
MJPEG_FRAME_DESC(0x0B, 800, 450, 0x100000, 30)

// Interface Frame MJPEG Descriptor ( 1024x576 30fps )
MJPEG_FRAME_DESC(0x0C, 1024, 576, 0x100000, 30)

#if BIND_SENSOR_AR0330
// Interface Frame MJPEG Descriptor ( 2304x1296 30fps )
MJPEG_FRAME_DESC(0x0D, 2304, 1296, 0x100000, 30)
#endif
#endif
#else
// Interface Frame MJPEG Descriptor ( 640x360 30fps )
MJPEG_FRAME_DESC(0x01, 640, 360, 0x100000, 30)

// Interface Frame MJPEG Descriptor ( 160x120 30fps )
MJPEG_FRAME_DESC(0x02, 160, 120, 0x100000, 30)

// Interface Frame MJPEG Descriptor ( 320x240 30fps )
MJPEG_FRAME_DESC(0x03, 320, 240, 0x100000, 30)

// Interface Frame MJPEG Descriptor ( 640x480 30fps )
MJPEG_FRAME_DESC(0x04, 640, 480, 0x100000, 30)

// Interface Frame MJPEG Descriptor ( 384x216 30fps )
MJPEG_FRAME_DESC(0x05, 384, 216, 0x100000, 30)

// Interface Frame MJPEG Descriptor ( 352x288 30fps )
MJPEG_FRAME_DESC(0x06, 352, 288, 0x100000, 30)

// Interface Frame MJPEG Descriptor ( 1280x720 30fps )
MJPEG_FRAME_DESC(0x07, 1280, 720, 0x100000, 30)

// Interface Frame MJPEG Descriptor ( 960x720 30fps )
MJPEG_FRAME_DESC(0x08, 960, 720, 0x100000, 30)

// Interface Frame MJPEG Descriptor ( 1024x576 30fps )
MJPEG_FRAME_DESC(0x09, 1024, 576, 0x100000, 30)

// Interface Frame MJPEG Descriptor ( 800x448 30fps )
MJPEG_FRAME_DESC(0x0A, 800, 448, 0x100000, 30)

// Interface Frame MJPEG Descriptor ( 800x600 30fps )
MJPEG_FRAME_DESC(0x0B, 800, 600, 0x100000, 30)

// Interface Frame MJPEG Descriptor ( 160x90 30fps )
MJPEG_FRAME_DESC(0x0C, 160, 90, 0x100000, 30)

// Interface Frame MJPEG Descriptor ( 320x180 30fps )
MJPEG_FRAME_DESC(0x0D, 320, 180, 0x100000, 30)

#if (SUPPORT_DUAL_DEVICE==0) && (SUPPORT_SWITCH_CAMERA==0)//not use for ASUS ov9726
#if (USB_UVC_5M_EN) && (USB_UVC_1080P_MJPEG_EN)
// Interface Frame MJPEG Descriptor ( 1920x1080 30fps )
MJPEG_FRAME_DESC(0x0E, 1920, 1080, 0x100000, 30)

// Interface Frame MJPEG Descriptor ( 1280x960 30fps )
MJPEG_FRAME_DESC(0x0F, 1280, 960, 0x100000, 30)

// Interface Frame MJPEG Descriptor ( 1600x1200 30fps )
MJPEG_FRAME_DESC(0x10, 1600, 1200, 0x100000, 30)

// Interface Frame MJPEG Descriptor ( 2048x1536 30fps )
MJPEG_FRAME_DESC(0x11, 2048, 1536, 0x100000, 30)

// Interface Frame MJPEG Descriptor ( 2592x1944 30fps )
MJPEG_FRAME_DESC(0x12, 2592, 1944, 0x100000, 30)

#elif (USB_UVC_5M_EN)
// Interface Frame MJPEG Descriptor ( 1280x960 30fps )
MJPEG_FRAME_DESC(0x0E, 1280, 960, 0x100000, 30)

// Interface Frame MJPEG Descriptor ( 1600x1200 30fps )
MJPEG_FRAME_DESC(0x0F, 1600, 1200, 0x100000, 30)

// Interface Frame MJPEG Descriptor ( 2048x1536 30fps )
MJPEG_FRAME_DESC(0x10, 2048, 1536, 0x100000, 30)

// Interface Frame MJPEG Descriptor ( 2592x1944 30fps )
MJPEG_FRAME_DESC(0x11, 2592, 1944, 0x100000, 30)

#elif (USB_UVC_1080P_MJPEG_EN)
// Interface Frame MJPEG Descriptor ( 1920x1080 30fps )
MJPEG_FRAME_DESC(0x0E, 1920, 1080, 0x100000, 30)

#endif
#endif//(SUPPORT_DUAL_DEVICE==0)&&(SUPPORT_SWITCH_CAMERA==0)
#endif//end of (CUSTOMER == ASU)
#if (USING_STILL_METHOD_1 == 0)
//Interface Still Image Frame Descriptor
#if BIND_SENSOR_AR0330
MJPEG_STILL_DESC(USB_UVC_MJPEG_STILL_DESC_SIZE, NUM_MJPG_STILL, \
                 RES_LE(1280, 720), RES_LE(640,480), RES_LE(640,360), RES_LE(320,240), RES_LE(320,180), RES_LE(160,120), RES_LE(160,90), RES_LE(1920,1080), RES_LE(2304,1296))
#elif BIND_SENSOR_AR0832E
MJPEG_STILL_DESC(USB_UVC_MJPEG_STILL_DESC_SIZE, NUM_MJPG_STILL, \
                 RES_LE(2592, 1944), RES_LE(2048,1536), RES_LE(1920,1080), RES_LE(1280,960), RES_LE(1280,720), RES_LE(640,480))
#else
MJPEG_STILL_DESC(USB_UVC_MJPEG_STILL_DESC_SIZE, NUM_MJPG_STILL, \
                 RES_LE(1280, 720), RES_LE(640,480), RES_LE(640,360), RES_LE(320,240), RES_LE(320,180), RES_LE(160,120), RES_LE(160,90))
#endif
#endif

// Interface Color Format
COLOR_DESC(1,1,4)

#endif //ENABLE_MJPEG


#if (SWAP_VIDEO_FORMAT_INDEX)  // YUY2 index is 1, MJPEG index is 2

#if ENABLE_YUY2
// Interface Format Uncompressed Descriptor
// 32595559-0000-0010-8000-00AA00389B71  'YUY2' == MEDIASUBTYPE_YUY2
YUY2_FORMAT_DESC(YUY2_FORMAT_INDEX, NUM_D1_YUY2_VIDEO)


// Interface Frame Uncompressed Descriptor ( 640x480 30fps )
YUY2_FRAME_DESC(0x01, 640, 480, 30)

// Interface Frame Uncompressed Descriptor ( 160x120 30fps )
YUY2_FRAME_DESC(0x02, 160, 120, 30)

// Interface Frame Uncompressed Descriptor ( 320x240 30fps )
YUY2_FRAME_DESC(0x03, 320, 240, 30)

// Interface Frame Uncompressed Descriptor ( 640x360 30fps )
YUY2_FRAME_DESC(0x04, 640, 360, 30)

// Interface Frame Uncompressed Descriptor ( 384x216 30fps )
YUY2_FRAME_DESC(0x05, 384, 216, 30)

// Interface Frame Uncompressed Descriptor ( 352x288 30fps )
YUY2_FRAME_DESC(0x06, 352, 288, 30)

// Interface Frame Uncompressed Descriptor ( 1280x720 30fps )
YUY2_FRAME_DESC(0x07, 1280, 720, 30)

// Interface Frame Uncompressed Descriptor ( 960x720 30fps )
YUY2_FRAME_DESC(0x08, 960, 720, 30)

// Interface Frame Uncompressed Descriptor ( 272x144 30fps )
YUY2_FRAME_DESC(0x09, 272, 144, 30)

// Interface Frame Uncompressed Descriptor ( 368x208 30fps )
YUY2_FRAME_DESC(0x0A, 368, 208, 30)

// Interface Frame Uncompressed Descriptor ( 480x272 30fps )
YUY2_FRAME_DESC(0x0B, 480, 272, 30)

// Interface Frame Uncompressed Descriptor ( 624x352 30fps )
YUY2_FRAME_DESC(0x0C, 624, 352, 30)

// Interface Frame Uncompressed Descriptor ( 912x512 30fps )
YUY2_FRAME_DESC(0x0D, 912, 512, 30)

// Interface Frame Uncompressed Descriptor ( 800x448 30fps )
YUY2_FRAME_DESC(0x0E, 800, 448, 30)

// Interface Frame Uncompressed Descriptor ( 800x600 30fps )
YUY2_FRAME_DESC(0x0F, 800, 600, 30)

// Interface Frame Uncompressed Descriptor ( 960x544 30fps )
YUY2_FRAME_DESC(0x10, 960, 544, 30)

// Interface Frame Uncompressed Descriptor ( 160x90 30fps )
YUY2_FRAME_DESC(0x11, 160, 90, 30)

// Interface Frame Uncompressed Descriptor ( 320x180 30fps )
YUY2_FRAME_DESC(0x12, 320, 180, 30)

#if USB_UVC_1080P_EN
// Interface Frame Uncompressed Descriptor ( 1920x1080 30fps )
YUY2_FRAME_DESC(0x13, 1920, 1080, 30)
#endif

#if (USING_STILL_METHOD_1 == 0)
//Interface Still Image Frame Descriptor
YUY2_STILL_DESC(USB_UVC_YUY2_STILL_DESC_SIZE, NUM_YUY2_STILL, 640, 640>>8, 480, 480>>8, 320, 320>>8, 240, 240>>8, 160, 160>>8, 120, 120>>8)
#endif

// Interface Color Format
COLOR_DESC(1,1,4)

#endif	//ENABLE_YUY2

#endif  //  #if (SWAP_VIDEO_FORMAT_INDEX)



#if ENABLE_FRAME_BASE_H264
// Interface Format Uncompressed Descriptor
// 31544941-0000-0010-8000-00AA00389B71  'AIT1' == MEDIASUBTYPE_AIT1
// 0x34363248,0x0000,0x0010,0x80,0x00,0x00,0xAA,0x00,0x38,0x9B,0x71 //FOURCC H264
H264_FORMAT_DESC(FRAME_BASE_H264_INDEX, NUM_H264_VIDEO)

// Interface Frame Uncompressed Descriptor ( 1280x720 30fps )
H264_FRAME_DESC(1, 1280, 720, 30)

// Interface Frame Uncompressed Descriptor ( 640x480 30fps )
H264_FRAME_DESC(2, 640, 480, 30)

// Interface Frame Uncompressed Descriptor ( 320x240 30fps )
H264_FRAME_DESC(3, 320, 240, 30)

// Interface Frame Uncompressed Descriptor ( 160x120 30fps )
H264_FRAME_DESC(4, 160, 120, 30)

// Interface Frame Uncompressed Descriptor ( 160x90 30fps )
H264_FRAME_DESC(5, 160, 90, 30)

// Interface Frame Uncompressed Descriptor ( 320x180 30fps )
H264_FRAME_DESC(6, 320, 180, 30)

// Interface Frame Uncompressed Descriptor ( 640x360 30fps )
H264_FRAME_DESC(7, 640, 360, 30)

// Interface Frame Uncompressed Descriptor ( 480x270 30fps )
H264_FRAME_DESC(8, 480, 270, 30)

// Interface Frame Uncompressed Descriptor ( 800x450 30fps )
H264_FRAME_DESC(9, 800, 450, 30)

// Interface Frame Uncompressed Descriptor ( 1024x576 30fps )
H264_FRAME_DESC(10, 1024, 576, 30)

#if USB_UVC_1080P_EN
// Interface Frame Uncompressed Descriptor ( 1920x1080 30fps )
H264_FRAME_DESC(11, 1920, 1080, 30)
#endif

// Interface Color Format
COLOR_DESC(1,1,4)

#endif //ENABLE_FRAME_BASE_H264
#if USB_UVC_BULK_EP
#else
// *******************************************************
// Interface Descriptor
USB_IF_UVC_STREAM_DESC_SIZE,
0x004,
UVC_D1_STREAM_IF1_NO,// interface
0x001,// alt.
0x001,// eps
0x00E,// class:video class
SC_VIDEOSTREAMING,// sub-class:video streaming
0x000,
0x000,
#endif

// Endpoint Descriptor
USB_EP_DESC_SIZE,// 
0x005,// endpoint descriptor type
//0x081,// EP1
(0x80|PCCAM_TX1_EP_ADDR),
// Tx Type
#if USB_UVC_BULK_EP
0x002, // Bulk
// Max Packet Size
LOBYTE(HS_TX_MAX_PK_SIZE ),
HIBYTE(HS_TX_MAX_PK_SIZE ),
#else
0x005, // ISO
// Max Packet Size
LOBYTE(HS_TX_MAX_PK_SIZE | TX_ADD_FRAME_BITS(TX_PER_FRAME-1)),
HIBYTE(HS_TX_MAX_PK_SIZE | TX_ADD_FRAME_BITS(TX_PER_FRAME-1)),
#endif
// Interval
#if USB_UVC_BULK_EP
0x000,
#else
0x001,
#endif

#if SUPPORT_DUAL_DEVICE                
// *******************************************************
// Interface Association Descriptor
USB_IF_ASC_DESC_SIZE,
0x00B,
UVC_D2_CTL_IF_NO,// first interface
NUM_OF_UVC_D2_IF,// num of interface
0x00E,// class:video class
0x003,// sub-class:video interface collection 
0x000,
0x004,//device 2 product name
// *******************************************************
// Interface Descriptor
USB_IF_UVC_CTL_DESC_SIZE,
0x004,
UVC_D2_CTL_IF_NO,// interface
0x000,// alt.
0x001,//number of endpoints in this interface
0x00E,// class:video class
SC_VIDEOCONTROL, //0x001,// sub-class:video control
0x000,
0x000,

// VC Interface Descriptor
USB_UVC_IF_CTL_HEADER_DESC_SIZE,
CS_INTERFACE,//0x024,
VC_HEADER,//0x001,// Header
0x000,// UVC Version 1.0 ( xp not support ver 1.1 )
0x001,
USB_UVC_IF_CTL_TOTAL_SIZE,
0x00,
LESBYTE(300000*1000),// sys clock - 300MHZ
LOSBYTE(300000*1000),
HISBYTE(300000*1000),
MSSBYTE(300000*1000),
NUM_OF_UVC_D2_STREAM_IF,// num of video stream
UVC_D2_STREAM_IF1_NO,// interface of video stream
//reserved for video stream 2


#if SKYPE_UVC_H264
// Interface Output Terminal Descriptor
VC_OT_DESC(UVC_OT_ID, UVC_EU3_ID)  // TID = 0x04, src ID = 0x02

// {A29E7641-DE04-47E3-8B2B-F4341AFF003B} for USBIF UVC 1.1 for H.264 Payload
VC_XU_DESC(UVC_EU3_ID, UVC_EU2_ID, UVC_EU3_GUID, 0x0B, 0x7F07)
#else
// Interface Output Terminal Descriptor
VC_OT_DESC(UVC_OT_ID, UVC_EU2_ID)  // TID = 0x04, src ID = 0x02
#endif

// Interface Extension Unit Descriptor
// {2C49D16A-32B8-4485-3EA8-643A152362F2} for LGT
#if (CUSTOMER == ASU)
VC_XU_DESC(UVC_EU2_ID, UVC_EU1_ID, UVC_EU2_GUID, 0x01, 0x0001)
#else
VC_XU_DESC(UVC_EU2_ID, UVC_EU1_ID, UVC_EU2_GUID, 0x06, 0x003F)
#endif


// Interface Extension Unit Descriptor
// {23E49ED0-1178-4f31-AE52-D2FB8A8D3B48} for AIT XU
#if (CUSTOMER == CCN) || (CUSTOMER == LON) || (CUSTOMER == ASU)
    #if SECS_VER > 0
    VC_XU_DESC(UVC_EU1_ID, UVC_EU0_ID, UVC_EU1_GUID, 0x05, 0xEFFF)
    #else
    VC_XU_DESC(UVC_EU1_ID, UVC_PU_ID, UVC_EU1_GUID, 0x05, 0xEFFF)
    #endif
#else
    #if SECS_VER > 0
    VC_XU_DESC(UVC_EU1_ID, UVC_EU0_ID, UVC_EU1_GUID, 0x05, 0x6FFF)
    #else
    VC_XU_DESC(UVC_EU1_ID, UVC_PU_ID, UVC_EU1_GUID, 0x05, 0x6FFF)
    #endif
#endif

#if (SECS_VER > 0)
// Interface Extension Unit Descriptor
// {B42153BD-35D6-45CA-B203-4E0149B301BC} for Skype API
VC_SKYPE_XU_DESC(UVC_EU0_ID, UVC_PU_ID, UVC_EU0_GUID, 0x20, 0x03803F9F)
#endif

// Interface Input(Camera) Terminal Descriptor
VC_IT_DESC(UVC_IT_ID,UVC_D2_IT_BITMAP)

// Interface Processing Unit Descriptor
VC_PU_DESC(UVC_PU_ID,UVC_IT_ID,UVC_D2_PU_BITMAP)

// Endpoint Descriptor
USB_EP_DESC_SIZE,
0x005,
(0x80|PCCAM_EX_EP_ADDR),// EP3
0x003,// INT
EX_EP_MAX_PK_SIZE,//0x008,// size
0x000,
0x008,//0x004,// interval

// Endpoint Interrupt Descriptor
USB_UVC_EP_INT_DESC_SIZE,
0x025,
0x003,// interrupt
EX_EP_MAX_PK_SIZE,//0x008,// size
0x000,

// *******************************************************
// Interface Descriptor
USB_IF_UVC_STREAM_DESC_SIZE,
0x004,
UVC_D2_STREAM_IF1_NO,// interface
0x000,// alt.
#if USB_UVC_BULK_EP
0x001,// eps
#else
0x000,// eps
#endif
0x00E,// class:video class
SC_VIDEOSTREAMING,// sub-class:video streaming
0x000,
0x000,

// Interface Input Header Descriptor
0x00D
#if ENABLE_YUY2
+0x01
#endif
#ifdef ENABLE_UYVY
+0x01
#endif
#ifdef ENABLE_NV12
+0x01
#endif
#if ENABLE_MJPEG
+0x01
#endif
#if ENABLE_FRAME_BASE_H264 // FrameBaseH264
+0x01
#endif
#ifdef ENABLE_FRAME_BASE_AVC1
+0x01
#endif
,
CS_INTERFACE,//0x024,
VS_INPUT_HEADER,//0x001,// Input Header
#if ENABLE_YUY2
0x001 //total format
#else
0x000
#endif
#ifdef ENABLE_UYVY
+0x01
#endif
#ifdef ENABLE_NV12
+0x01
#endif
#if ENABLE_MJPEG
+0x01
#endif
#if ENABLE_FRAME_BASE_H264 // FrameBaseH264
+0x01
#endif
#ifdef ENABLE_FRAME_BASE_AVC1
+0x01
#endif
,

LOBYTE(UVC_D2_INPUT_HEADER_LENGTH),      
HIBYTE(UVC_D2_INPUT_HEADER_LENGTH),      
(0x080|PCCAM_TX1_EP_ADDR),// video endpoint
0x000,
UVC_OT_ID, //0x004,//0x003,// linkID
#if USING_STILL_METHOD_1
0x000,//0x002, //0x001,//still method 1 //0x002,// still method 2
#else
0x002,//0x002, //0x001,//still method 1 //0x002,// still method 2
#endif
0x001,// Hardware still trigger support, 0: Not supported, 1: Supported
0x000,// Trigger usage, 0:Initiate still image capture, 1: General purpose button event
0x001,// bControlSize, size of each bmaControls(x) field, in bytes
#if ENABLE_YUY2
0x000,
#endif
#ifdef ENABLE_UYVY
0x000,
#endif
#ifdef ENABLE_NV12
0x000,
#endif
#if ENABLE_MJPEG
0x000,
#endif
#if ENABLE_FRAME_BASE_H264 
0x000,
#endif
#ifdef ENABLE_FRAME_BASE_AVC1
0x000,
#endif

#if (SWAP_VIDEO_FORMAT_INDEX == 0)  // YUY2 index is 1, MJPEG index is 2

#if ENABLE_YUY2
// Interface Format Uncompressed Descriptor
// 32595559-0000-0010-8000-00AA00389B71  'YUY2' == MEDIASUBTYPE_YUY2
YUY2_FORMAT_DESC(YUY2_FORMAT_INDEX, NUM_D2_YUY2_VIDEO)

#if (CUSTOMER == ASU)
// Interface Frame Uncompressed Descriptor ( 640x480 30fps )
YUY2_FRAME_DESC(0x01, 640, 480, 30)

#else
// Interface Frame Uncompressed Descriptor ( 640x480 30fps )
YUY2_FRAME_DESC(0x01, 640, 480, 30)

// Interface Frame Uncompressed Descriptor ( 160x120 30fps )
YUY2_FRAME_DESC(0x02, 160, 120, 30)

// Interface Frame Uncompressed Descriptor ( 320x240 30fps )
YUY2_FRAME_DESC(0x03, 320, 240, 30)

// Interface Frame Uncompressed Descriptor ( 640x360 30fps )
YUY2_FRAME_DESC(0x04, 640, 360, 30)

// Interface Frame Uncompressed Descriptor ( 384x216 30fps )
YUY2_FRAME_DESC(0x05, 384, 216, 30)

// Interface Frame Uncompressed Descriptor ( 352x288 30fps )
YUY2_FRAME_DESC(0x06, 352, 288, 30)

#if NUM_D2_YUY2_VIDEO > 6
// Interface Frame Uncompressed Descriptor ( 1280x720 30fps )
YUY2_FRAME_DESC(0x07, 1280, 720, 30)

// Interface Frame Uncompressed Descriptor ( 960x720 30fps )
YUY2_FRAME_DESC(0x08, 960, 720, 30)

// Interface Frame Uncompressed Descriptor ( 800x448 30fps )
YUY2_FRAME_DESC(0x09, 800, 448, 30)

// Interface Frame Uncompressed Descriptor ( 800x600 30fps )
YUY2_FRAME_DESC(0x0A, 800, 600, 30)

// Interface Frame Uncompressed Descriptor ( 160x90 30fps )
YUY2_FRAME_DESC(0x0B, 160, 90, 30)

// Interface Frame Uncompressed Descriptor ( 320x180 30fps )
YUY2_FRAME_DESC(0x0C, 320, 180, 30)
#endif
#if (USB_UVC_1080P_YUY2_EN)
// Interface Frame Uncompressed Descriptor ( 1920x1080 30fps )
YUY2_FRAME_DESC(0x0D, 1920, 1080, 30)
#endif
#if (USB_UVC_5M_EN)
// Interface Frame Uncompressed Descriptor ( 1024x768 30fps )
YUY2_FRAME_DESC(0x0E, 1024, 768, 30)

// Interface Frame Uncompressed Descriptor ( 1600x1200 30fps )
YUY2_FRAME_DESC(0x0F, 1600, 1200, 30)

// Interface Frame Uncompressed Descriptor ( 2048x1536 30fps )
YUY2_FRAME_DESC(0x10, 2048, 1536, 30)

// Interface Frame Uncompressed Descriptor ( 2592x1944 30fps )
YUY2_FRAME_DESC(0x11, 2592, 1944, 30)
#endif
#endif//end of (CUSTOMER == ASU)

#if (USING_STILL_METHOD_1 == 0)
//Interface Still Image Frame Descriptor
#if NUM_YUY2_STILL
YUY2_STILL_DESC(USB_UVC_YUY2_STILL_DESC_SIZE, NUM_YUY2_STILL, RES_LE(640,480), RES_LE(320,240), RES_LE(160,120))
#endif
#endif

// Interface Color Format
COLOR_DESC(1,1,4)

#endif	//ENABLE_YUY2

#endif  //  #if (SWAP_VIDEO_FORMAT_INDEX == 0)


// Interface Format MJPEG Descriptor
#if ENABLE_MJPEG

MJPEG_FORMAT_DESC(MJPEG_FORMAT_INDEX, NUM_D2_MJPG_VIDEO)
#if (CUSTOMER == ASU)
// Interface Frame MJPEG Descriptor ( 640x480 30fps )
MJPEG_FRAME_DESC(0x01, 640, 480, 0x100000, 30)

// Interface Frame MJPEG Descriptor ( 1280x720 30fps )
MJPEG_FRAME_DESC(0x02, 1280, 720, 0x100000, 30)

// Interface Frame MJPEG Descriptor ( 1280x960 30fps )
MJPEG_FRAME_DESC(0x03, 1280, 960, 0x100000, 30)

// Interface Frame MJPEG Descriptor ( 1920x1080 30fps )
MJPEG_FRAME_DESC(0x04, 1920, 1080, 0x100000, 30)

// Interface Frame MJPEG Descriptor ( 2592x1944 30fps )
MJPEG_FRAME_DESC(0x05, 2592, 1944, 0x100000, 15)

#else
// Interface Frame MJPEG Descriptor ( 1280x720 30fps )
MJPEG_FRAME_DESC(0x01, 1280, 720, 0x100000, 30)

// Interface Frame MJPEG Descriptor ( 160x120 30fps )
MJPEG_FRAME_DESC(0x02, 160, 120, 0x100000, 30)

// Interface Frame MJPEG Descriptor ( 320x240 30fps )
MJPEG_FRAME_DESC(0x03, 320, 240, 0x100000, 30)

// Interface Frame MJPEG Descriptor ( 640x360 30fps )
MJPEG_FRAME_DESC(0x04, 640, 360, 0x100000, 30)

// Interface Frame MJPEG Descriptor ( 384x216 30fps )
MJPEG_FRAME_DESC(0x05, 384, 216, 0x100000, 30)

// Interface Frame MJPEG Descriptor ( 352x288 30fps )
MJPEG_FRAME_DESC(0x06, 352, 288, 0x100000, 30)

// Interface Frame MJPEG Descriptor ( 640x480 30fps )
MJPEG_FRAME_DESC(0x07, 640, 480, 0x100000, 30)

// Interface Frame MJPEG Descriptor ( 960x720 30fps )
MJPEG_FRAME_DESC(0x08, 960, 720, 0x100000, 30)

// Interface Frame MJPEG Descriptor ( 912x512 30fps )
MJPEG_FRAME_DESC(0x09, 1024, 576, 0x100000, 30)

// Interface Frame MJPEG Descriptor ( 800x448 30fps )
MJPEG_FRAME_DESC(0x0A, 800, 448, 0x100000, 30)

// Interface Frame MJPEG Descriptor ( 800x600 30fps )
MJPEG_FRAME_DESC(0x0B, 800, 600, 0x100000, 30)

// Interface Frame MJPEG Descriptor ( 160x90 30fps )
MJPEG_FRAME_DESC(0x0C, 160, 90, 0x100000, 30)

// Interface Frame MJPEG Descriptor ( 320x180 30fps )
MJPEG_FRAME_DESC(0x0D, 320, 180, 0x100000, 30)


#if (USB_UVC_5M_EN) && (USB_UVC_1080P_MJPEG_EN)
// Interface Frame MJPEG Descriptor ( 1920x1080 30fps )
MJPEG_FRAME_DESC(0x0E, 1920, 1080, 0x100000, 30)

// Interface Frame MJPEG Descriptor ( 1280x960 30fps )
MJPEG_FRAME_DESC(0x0F, 1280, 960, 0x100000, 30)

// Interface Frame MJPEG Descriptor ( 1600x1200 30fps )
MJPEG_FRAME_DESC(0x10, 1600, 1200, 0x100000, 30)

// Interface Frame MJPEG Descriptor ( 2048x1536 30fps )
MJPEG_FRAME_DESC(0x11, 2048, 1536, 0x100000, 30)

// Interface Frame MJPEG Descriptor ( 2592x1944 30fps )
MJPEG_FRAME_DESC(0x12, 2592, 1944, 0x100000, 30)

#elif (USB_UVC_5M_EN)
// Interface Frame MJPEG Descriptor ( 1280x960 30fps )
MJPEG_FRAME_DESC(0x0E, 1280, 960, 0x100000, 30)

// Interface Frame MJPEG Descriptor ( 1600x1200 30fps )
MJPEG_FRAME_DESC(0x0F, 1600, 1200, 0x100000, 30)

// Interface Frame MJPEG Descriptor ( 2048x1536 30fps )
MJPEG_FRAME_DESC(0x10, 2048, 1536, 0x100000, 30)

// Interface Frame MJPEG Descriptor ( 2592x1944 30fps )
MJPEG_FRAME_DESC(0x11, 2592, 1944, 0x100000, 30)

#elif (USB_UVC_1080P_MJPEG_EN)
// Interface Frame MJPEG Descriptor ( 1920x1080 30fps )
MJPEG_FRAME_DESC(0x0E, 1920, 1080, 0x100000, 30)

#endif
#endif//end of (CUSTOMER == ASU)

#if (USING_STILL_METHOD_1 == 0)
//Interface Still Image Frame Descriptor
MJPEG_STILL_DESC(USB_UVC_MJPEG_STILL_DESC_SIZE, NUM_MJPG_STILL, \
                 RES_LE(1280, 720), RES_LE(640,480), RES_LE(640,360), RES_LE(320,240), RES_LE(320,180), RES_LE(160,120), RES_LE(160,90))
#endif

// Interface Color Format
COLOR_DESC(1,1,4)

#endif //ENABLE_MJPEG


#if (SWAP_VIDEO_FORMAT_INDEX)  // YUY2 index is 1, MJPEG index is 2

#if ENABLE_YUY2
// Interface Format Uncompressed Descriptor
// 32595559-0000-0010-8000-00AA00389B71  'YUY2' == MEDIASUBTYPE_YUY2
YUY2_FORMAT_DESC(YUY2_FORMAT_INDEX, NUM_D1_YUY2_VIDEO)


// Interface Frame Uncompressed Descriptor ( 640x480 30fps )
YUY2_FRAME_DESC(0x01, 640, 480, 30)

// Interface Frame Uncompressed Descriptor ( 160x120 30fps )
YUY2_FRAME_DESC(0x02, 160, 120, 30)

// Interface Frame Uncompressed Descriptor ( 320x240 30fps )
YUY2_FRAME_DESC(0x03, 320, 240, 30)

// Interface Frame Uncompressed Descriptor ( 640x360 30fps )
YUY2_FRAME_DESC(0x04, 640, 360, 30)

// Interface Frame Uncompressed Descriptor ( 384x216 30fps )
YUY2_FRAME_DESC(0x05, 384, 216, 30)

// Interface Frame Uncompressed Descriptor ( 352x288 30fps )
YUY2_FRAME_DESC(0x06, 352, 288, 30)

// Interface Frame Uncompressed Descriptor ( 1280x720 30fps )
YUY2_FRAME_DESC(0x07, 1280, 720, 30)

// Interface Frame Uncompressed Descriptor ( 960x720 30fps )
YUY2_FRAME_DESC(0x08, 960, 720, 30)

// Interface Frame Uncompressed Descriptor ( 272x144 30fps )
YUY2_FRAME_DESC(0x09, 272, 144, 30)

// Interface Frame Uncompressed Descriptor ( 368x208 30fps )
YUY2_FRAME_DESC(0x0A, 368, 208, 30)

// Interface Frame Uncompressed Descriptor ( 480x272 30fps )
YUY2_FRAME_DESC(0x0B, 480, 272, 30)

// Interface Frame Uncompressed Descriptor ( 624x352 30fps )
YUY2_FRAME_DESC(0x0C, 624, 352, 30)

// Interface Frame Uncompressed Descriptor ( 912x512 30fps )
YUY2_FRAME_DESC(0x0D, 912, 512, 30)

// Interface Frame Uncompressed Descriptor ( 800x448 30fps )
YUY2_FRAME_DESC(0x0E, 800, 448, 30)

// Interface Frame Uncompressed Descriptor ( 800x600 30fps )
YUY2_FRAME_DESC(0x0F, 800, 600, 30)

// Interface Frame Uncompressed Descriptor ( 960x544 30fps )
YUY2_FRAME_DESC(0x10, 960, 544, 30)

// Interface Frame Uncompressed Descriptor ( 160x90 30fps )
YUY2_FRAME_DESC(0x11, 160, 90, 30)

// Interface Frame Uncompressed Descriptor ( 320x180 30fps )
YUY2_FRAME_DESC(0x12, 320, 180, 30)

#if USB_UVC_1080P_EN
// Interface Frame Uncompressed Descriptor ( 1920x1080 30fps )
YUY2_FRAME_DESC(0x13, 1920, 1080, 30)
#endif

#if (USING_STILL_METHOD_1 == 0)
//Interface Still Image Frame Descriptor
YUY2_STILL_DESC(USB_UVC_YUY2_STILL_DESC_SIZE, NUM_YUY2_STILL, 640, 640>>8, 480, 480>>8, 320, 320>>8, 240, 240>>8, 160, 160>>8, 120, 120>>8)
#endif

// Interface Color Format
COLOR_DESC(1,1,4)

#endif	//ENABLE_YUY2

#endif  //  #if (SWAP_VIDEO_FORMAT_INDEX)



#if ENABLE_FRAME_BASE_H264
// Interface Format Uncompressed Descriptor
// 31544941-0000-0010-8000-00AA00389B71  'AIT1' == MEDIASUBTYPE_AIT1
// 0x34363248,0x0000,0x0010,0x80,0x00,0x00,0xAA,0x00,0x38,0x9B,0x71 //FOURCC H264
H264_FORMAT_DESC(FRAME_BASE_H264_INDEX, NUM_H264_VIDEO)

// Interface Frame Uncompressed Descriptor ( 1280x720 30fps )
H264_FRAME_DESC(1, 1280, 720, 30)

// Interface Frame Uncompressed Descriptor ( 640x480 30fps )
H264_FRAME_DESC(2, 640, 480, 30)

// Interface Frame Uncompressed Descriptor ( 320x240 30fps )
H264_FRAME_DESC(3, 320, 240, 30)

// Interface Frame Uncompressed Descriptor ( 160x120 30fps )
H264_FRAME_DESC(4, 160, 120, 30)

// Interface Frame Uncompressed Descriptor ( 160x90 30fps )
H264_FRAME_DESC(5, 160, 90, 30)

// Interface Frame Uncompressed Descriptor ( 320x180 30fps )
H264_FRAME_DESC(6, 320, 180, 30)

// Interface Frame Uncompressed Descriptor ( 640x360 30fps )
H264_FRAME_DESC(7, 640, 360, 30)

// Interface Frame Uncompressed Descriptor ( 480x270 30fps )
H264_FRAME_DESC(8, 480, 270, 30)

// Interface Frame Uncompressed Descriptor ( 800x450 30fps )
H264_FRAME_DESC(9, 800, 450, 30)

// Interface Frame Uncompressed Descriptor ( 1024x576 30fps )
H264_FRAME_DESC(10, 1024, 576, 30)

#if USB_UVC_1080P_EN
// Interface Frame Uncompressed Descriptor ( 1920x1080 30fps )
H264_FRAME_DESC(11, 1920, 1080, 30)
#endif

// Interface Color Format
COLOR_DESC(1,1,4)

#endif //ENABLE_FRAME_BASE_H264
#if USB_UVC_BULK_EP
#else
// *******************************************************
// Interface Descriptor
USB_IF_UVC_STREAM_DESC_SIZE,
0x004,
UVC_D2_STREAM_IF1_NO,// interface
0x001,// alt.
0x001,// eps
0x00E,// class:video class
SC_VIDEOSTREAMING,// sub-class:video streaming
0x000,
0x000,
#endif

// Endpoint Descriptor
USB_EP_DESC_SIZE,// 
0x005,// endpoint descriptor type
//0x081,// EP1
(0x80|PCCAM_TX1_EP_ADDR),
// Tx Type
#if USB_UVC_BULK_EP
0x002, // Bulk
// Max Packet Size
LOBYTE(HS_TX_MAX_PK_SIZE ),
HIBYTE(HS_TX_MAX_PK_SIZE ),
#else
0x005, // ISO
// Max Packet Size
LOBYTE(HS_TX_MAX_PK_SIZE | TX_ADD_FRAME_BITS(TX_PER_FRAME-1)),
HIBYTE(HS_TX_MAX_PK_SIZE | TX_ADD_FRAME_BITS(TX_PER_FRAME-1)),
#endif
// Interval
#if USB_UVC_BULK_EP
0x000,
#else
0x001,
#endif

#endif//SUPPORT_DUAL_DEVICE
#if SUPPORT_UAC
// *******************************************************
// Interface Association Descriptor
USB_IF_ASC_DESC_SIZE,
0x00B,
UAC_CTL_IF_NO,// first interface
NUM_OF_UAC_IF,// num of interface
0x001,// class:audio class
0x002,// sub-class:audio stream
0x000,
0x000,

// *******************************************************
// Interface Descriptor
USB_IF_UAC_CTL_DESC_SIZE,
0x004,
UAC_CTL_IF_NO,// interface
0x000,// alt.
0x000,
0x001,// class:audio class
0x001,// sub-class:audio control
0x000,
0x000,

// Interface Header Descriptor
USB_UAC_IF_CTL_HEADER_DESC_SIZE,
0x024,
0x001,// Header
0x000,// UAC Version 1.0 ( xp not support ver 2.0 )
0x001,
//0x026,// total size
//0x000,
LOBYTE(USB_UAC_IF_CTL_TOTAL_SIZE),      
HIBYTE(USB_UAC_IF_CTL_TOTAL_SIZE),      
0x001,// num of audio stream
UAC_STREAM_IF_NO,// interface of audio stream

// Interface Input Terminal Descriptor
USB_UAC_IF_CTL_IT_DESC_SIZE,
0x024,
0x002,// Input Terminal
0x001,// TID
0x001,// input type Microphone
0x002,
0x000,
AUDIN_CHANNEL,
#if AUDIN_CHANNEL==2
0x003,
#endif
#if AUDIN_CHANNEL==1
0x000,
#endif
0x000,
0x000,
0x000,

// Interface Output Terminal Descriptor
USB_UAC_IF_CTL_OT_DESC_SIZE,
0x024,
0x003,// Output Terminal
0x003,// TID
0x001,// output type streaming
0x001,
0x000,// assoc TID ( 0 or 1? )
0x005,// src ID
0x000,

// Interface Feature Unit Descriptor
USB_UAC_IF_CTL_FU_DESC_SIZE,
0x024,
0x006,// Feature Unit
0x005,// UID
0x001,// src ID
0x001,// num of control byte
0x003,// mute, volume
0x000,

// *******************************************************
// Interface Descriptor
USB_IF_UAC_STREAM_DESC_SIZE,
0x004,
UAC_STREAM_IF_NO,// interface
0x000,// alt.
0x000,
0x001,// class:audio class
0x002,// sub-class:audio streaming
0x000,
0x000,

// *******************************************************
// Interface Descriptor
USB_IF_UAC_STREAM_DESC_SIZE,
0x004,
UAC_STREAM_IF_NO,// interface
0x001,// alt.
0x001,// eps
0x001,// class:audio class
0x002,// sub-class:audio streaming
0x000,
0x000,

// Interface General Descriptor
USB_UAC_IF_STREAM_GENERAL_DESC_SIZE,
0x024,
0x001,// General
0x003,// endpoint link TID
0x002,//0x001,// delay ms ( num of frames )
0x001,// FormatTag, 1: PCM data format
0x000,

#if (CUSTOMER == LIT) || (CUSTOMER == LGT)
UAC_PCM_FORMAT_DESC(USB_UAC_IF_STREAM_FORMAT_PCM_DESC_SIZE,AUDIN_CHANNEL,2,16,NUM_OF_UAC_SAMPLING_RATE\
,LESBYTE(16000),LOSBYTE(16000),HISBYTE(16000)\
/*,LESBYTE(24000),LOSBYTE(24000),HISBYTE(24000)\*/
)
#elif ((CUSTOMER == CCN)&&(MODEL == 1))
UAC_PCM_FORMAT_DESC(USB_UAC_IF_STREAM_FORMAT_PCM_DESC_SIZE,AUDIN_CHANNEL,2,16,NUM_OF_UAC_SAMPLING_RATE\
,LESBYTE(16000),LOSBYTE(16000),HISBYTE(16000)\
/*,LESBYTE(24000),LOSBYTE(24000),HISBYTE(24000)\*/
,LESBYTE(8000),LOSBYTE(8000),HISBYTE(8000)\
/*,LESBYTE(48000),LOSBYTE(48000),HISBYTE(48000)\*/
)
#elif ((CUSTOMER == CCN)&&(MODEL == 0))// || (CUSTOMER == SNO)
UAC_PCM_FORMAT_DESC(USB_UAC_IF_STREAM_FORMAT_PCM_DESC_SIZE,AUDIN_CHANNEL,2,16,NUM_OF_UAC_SAMPLING_RATE\
,LESBYTE(16000),LOSBYTE(16000),HISBYTE(16000)\
/*,LESBYTE(24000),LOSBYTE(24000),HISBYTE(24000)\*/
,LESBYTE(8000),LOSBYTE(8000),HISBYTE(8000)\
/*,LESBYTE(48000),LOSBYTE(48000),HISBYTE(48000)\*/
)
#elif (CUSTOMER == ANW)
UAC_PCM_FORMAT_DESC(USB_UAC_IF_STREAM_FORMAT_PCM_DESC_SIZE,AUDIN_CHANNEL,2,16,NUM_OF_UAC_SAMPLING_RATE\
,LESBYTE(16000),LOSBYTE(16000),HISBYTE(16000)\
,LESBYTE(8000),LOSBYTE(8000),HISBYTE(8000)\
)
#else
UAC_PCM_FORMAT_DESC(USB_UAC_IF_STREAM_FORMAT_PCM_DESC_SIZE,AUDIN_CHANNEL,2,16,NUM_OF_UAC_SAMPLING_RATE\
,LESBYTE(AUDIN_SAMPLERATE),LOSBYTE(AUDIN_SAMPLERATE),HISBYTE(AUDIN_SAMPLERATE)\
)
#endif

// Endpoint Descriptor
USB_UAC_EP_DESC_SIZE,
0x005,
//0x082,// EP2
(0x80|PCCAM_AU_EP_ADDR),
#if (UAC_SYNC_MODE_EN == 1)
0x0D,	// iso + sync
#else
0x005,// ISO + async
#endif
//AUDIO_PACKET_SIZE(AUDIN_SAMPLERATE,AUDIN_CHANNEL),
(AU_EP_MAX_PK_SIZE_HS & 0xFF),
(AU_EP_MAX_PK_SIZE_HS >> 8),

0x004,// 4 packets per frame
0x000,
0x000,

// Endpoint General Descriptor
USB_UAC_EP_GENERAL_DESC_SIZE,
0x025,
0x001,// General
0x001,// pitch control
0x000,
0x000,
0x000,
#endif  // end of #if SUPPORT_UAC

#if SUPPORT_HID_FUNC
/* New Interface descriptor */
0x09,
0x04,
#if SUPPORT_UAC
0x04,
#else
0x02,
#endif
0x00,
0x01,
0x03,
0x01,
0x01,   //0x00:None , keyboard:0x01, mouse:0x02, 
0x00,

/* HID descriptor */
0x09,
0x21,
0x01,
0x01,
0x00,
0x01,
0x22,
(REPORT_DESCRIPTOR_LEN & 0xFF),
((REPORT_DESCRIPTOR_LEN >> 8) & 0xFF),


/* endpoint descriptor */
0x07,
0x05,
0x80|HID_EP_ADDR,
0x03,
HID_MAX_PK_SIZE,
0x05,
0x00,
#endif  // end of #if SUPPORT_HID_FUNC
};

#if (SUPPORT_SWITCH_CAMERA)
MMP_UBYTE   HS_CONFIG_DESCRIPTOR_DATA2[CAMERA_2_CONFIG_DESCRIPTOR_LEN] =
{
// configuration descriptor
USB_CFG_DESC_SIZE,
0x002,
LOBYTE(CAMERA_2_CONFIG_DESCRIPTOR_LEN),      
HIBYTE(CAMERA_2_CONFIG_DESCRIPTOR_LEN),      
NUM_OF_CONFIG_2_TOTAL_IF,// num of interface

0x001,
0x000,
0x080,
0x0FA,                    

// *******************************************************
// Interface Association Descriptor
USB_IF_ASC_DESC_SIZE,
0x00B,
UVC_D2_CTL_IF_NO,// first interface
NUM_OF_UVC_D2_IF,// num of interface
0x00E,// class:video class
0x003,// sub-class:video interface collection 
0x000,
0x004,//device 2 product name
// *******************************************************
// Interface Descriptor
USB_IF_UVC_CTL_DESC_SIZE,
0x004,
UVC_D2_CTL_IF_NO,// interface
0x000,// alt.
0x001,//number of endpoints in this interface
0x00E,// class:video class
SC_VIDEOCONTROL, //0x001,// sub-class:video control
0x000,
0x000,

// VC Interface Descriptor
USB_UVC_IF_CTL_HEADER_DESC_SIZE,
CS_INTERFACE,//0x024,
VC_HEADER,//0x001,// Header
0x000,// UVC Version 1.0 ( xp not support ver 1.1 )
0x001,
USB_UVC_IF_CTL_TOTAL_SIZE,
0x00,
LESBYTE(300000*1000),// sys clock - 300MHZ
LOSBYTE(300000*1000),
HISBYTE(300000*1000),
MSSBYTE(300000*1000),
NUM_OF_UVC_D2_STREAM_IF,// num of video stream
UVC_D2_STREAM_IF1_NO,// interface of video stream
//reserved for video stream 2


#if SKYPE_UVC_H264
// Interface Output Terminal Descriptor
VC_OT_DESC(UVC_OT_ID, UVC_EU3_ID)  // TID = 0x04, src ID = 0x02

// {A29E7641-DE04-47E3-8B2B-F4341AFF003B} for USBIF UVC 1.1 for H.264 Payload
VC_XU_DESC(UVC_EU3_ID, UVC_EU2_ID, UVC_EU3_GUID, 0x0B, 0x7F07)
#else
// Interface Output Terminal Descriptor
VC_OT_DESC(UVC_OT_ID, UVC_EU2_ID)  // TID = 0x04, src ID = 0x02
#endif

// Interface Extension Unit Descriptor
// {2C49D16A-32B8-4485-3EA8-643A152362F2} for LGT
#if (CUSTOMER == ASU)
//VC_XU_DESC(UVC_EU2_ID, UVC_EU1_ID, UVC_EU2_GUID, 0x05, 0x001F)
VC_XU_DESC(UVC_EU2_ID, UVC_EU1_ID, UVC_EU2_GUID, 0x01, 0x0001)
#else
VC_XU_DESC(UVC_EU2_ID, UVC_EU1_ID, UVC_EU2_GUID, 0x06, 0x003F)
#endif


// Interface Extension Unit Descriptor
// {23E49ED0-1178-4f31-AE52-D2FB8A8D3B48} for AIT XU
#if (CUSTOMER == CCN) || (CUSTOMER == LON) || (CUSTOMER == ASU)
    #if SECS_VER > 0
    VC_XU_DESC(UVC_EU1_ID, UVC_EU0_ID, UVC_EU1_GUID, 0x05, 0xEFFF)
    #else
    VC_XU_DESC(UVC_EU1_ID, UVC_PU_ID, UVC_EU1_GUID, 0x05, 0xEFFF)
    #endif
#else
    #if SECS_VER > 0
    VC_XU_DESC(UVC_EU1_ID, UVC_EU0_ID, UVC_EU1_GUID, 0x05, 0x6FFF)
    #else
    VC_XU_DESC(UVC_EU1_ID, UVC_PU_ID, UVC_EU1_GUID, 0x05, 0x6FFF)
    #endif
#endif

#if (SECS_VER > 0)
// Interface Extension Unit Descriptor
// {B42153BD-35D6-45CA-B203-4E0149B301BC} for Skype API
VC_SKYPE_XU_DESC(UVC_EU0_ID, UVC_PU_ID, UVC_EU0_GUID, 0x20, 0x03803F9F)
#endif

// Interface Input(Camera) Terminal Descriptor
VC_IT_DESC(UVC_IT_ID,UVC_D2_IT_BITMAP)

// Interface Processing Unit Descriptor
VC_PU_DESC(UVC_PU_ID,UVC_IT_ID,UVC_D2_PU_BITMAP)

// Endpoint Descriptor
USB_EP_DESC_SIZE,
0x005,
(0x80|PCCAM_EX_EP_ADDR),// EP3
0x003,// INT
EX_EP_MAX_PK_SIZE,//0x008,// size
0x000,
0x008,//0x004,// interval

// Endpoint Interrupt Descriptor
USB_UVC_EP_INT_DESC_SIZE,
0x025,
0x003,// interrupt
EX_EP_MAX_PK_SIZE,//0x008,// size
0x000,

// *******************************************************
// Interface Descriptor
USB_IF_UVC_STREAM_DESC_SIZE,
0x004,
UVC_D2_STREAM_IF1_NO,// interface
0x000,// alt.
#if USB_UVC_BULK_EP
0x001,// eps
#else
0x000,// eps
#endif
0x00E,// class:video class
SC_VIDEOSTREAMING,// sub-class:video streaming
0x000,
0x000,

// Interface Input Header Descriptor
0x00D
#if ENABLE_YUY2
+0x01
#endif
#ifdef ENABLE_UYVY
+0x01
#endif
#ifdef ENABLE_NV12
+0x01
#endif
#if ENABLE_MJPEG
+0x01
#endif
#if ENABLE_FRAME_BASE_H264 // FrameBaseH264
+0x01
#endif
#ifdef ENABLE_FRAME_BASE_AVC1
+0x01
#endif
,
CS_INTERFACE,//0x024,
VS_INPUT_HEADER,//0x001,// Input Header
#if ENABLE_YUY2
0x001 //total format
#else
0x000
#endif
#ifdef ENABLE_UYVY
+0x01
#endif
#ifdef ENABLE_NV12
+0x01
#endif
#if ENABLE_MJPEG
+0x01
#endif
#if ENABLE_FRAME_BASE_H264 // FrameBaseH264
+0x01
#endif
#ifdef ENABLE_FRAME_BASE_AVC1
+0x01
#endif
,

LOBYTE(UVC_D2_INPUT_HEADER_LENGTH),      
HIBYTE(UVC_D2_INPUT_HEADER_LENGTH),      
(0x080|PCCAM_TX1_EP_ADDR),// video endpoint
0x000,
UVC_OT_ID, //0x004,//0x003,// linkID
#if USING_STILL_METHOD_1
0x000,//0x002, //0x001,//still method 1 //0x002,// still method 2
#else
0x002,//0x002, //0x001,//still method 1 //0x002,// still method 2
#endif
0x001,// Hardware still trigger support, 0: Not supported, 1: Supported
0x000,// Trigger usage, 0:Initiate still image capture, 1: General purpose button event
0x001,// bControlSize, size of each bmaControls(x) field, in bytes
#if ENABLE_YUY2
0x000,
#endif
#ifdef ENABLE_UYVY
0x000,
#endif
#ifdef ENABLE_NV12
0x000,
#endif
#if ENABLE_MJPEG
0x000,
#endif
#if ENABLE_FRAME_BASE_H264 
0x000,
#endif
#ifdef ENABLE_FRAME_BASE_AVC1
0x000,
#endif

#if (SWAP_VIDEO_FORMAT_INDEX == 0)  // YUY2 index is 1, MJPEG index is 2

#if ENABLE_YUY2
// Interface Format Uncompressed Descriptor
// 32595559-0000-0010-8000-00AA00389B71  'YUY2' == MEDIASUBTYPE_YUY2
YUY2_FORMAT_DESC(YUY2_FORMAT_INDEX, NUM_D2_YUY2_VIDEO)
#if (CUSTOMER == ASU)
// Interface Frame Uncompressed Descriptor ( 640x480 30fps )
YUY2_FRAME_DESC(0x01, 640, 480, 30)

#else
// Interface Frame Uncompressed Descriptor ( 640x480 30fps )
YUY2_FRAME_DESC(0x01, 640, 480, 30)

// Interface Frame Uncompressed Descriptor ( 160x120 30fps )
YUY2_FRAME_DESC(0x02, 160, 120, 30)

// Interface Frame Uncompressed Descriptor ( 320x240 30fps )
YUY2_FRAME_DESC(0x03, 320, 240, 30)

// Interface Frame Uncompressed Descriptor ( 640x360 30fps )
YUY2_FRAME_DESC(0x04, 640, 360, 30)

// Interface Frame Uncompressed Descriptor ( 384x216 30fps )
YUY2_FRAME_DESC(0x05, 384, 216, 30)

// Interface Frame Uncompressed Descriptor ( 352x288 30fps )
YUY2_FRAME_DESC(0x06, 352, 288, 30)

#if NUM_D2_YUY2_VIDEO > 6
// Interface Frame Uncompressed Descriptor ( 1280x720 30fps )
YUY2_FRAME_DESC(0x07, 1280, 720, 30)

// Interface Frame Uncompressed Descriptor ( 960x720 30fps )
YUY2_FRAME_DESC(0x08, 960, 720, 30)

// Interface Frame Uncompressed Descriptor ( 800x448 30fps )
YUY2_FRAME_DESC(0x09, 800, 448, 30)

// Interface Frame Uncompressed Descriptor ( 800x600 30fps )
YUY2_FRAME_DESC(0x0A, 800, 600, 30)

// Interface Frame Uncompressed Descriptor ( 160x90 30fps )
YUY2_FRAME_DESC(0x0B, 160, 90, 30)

// Interface Frame Uncompressed Descriptor ( 320x180 30fps )
YUY2_FRAME_DESC(0x0C, 320, 180, 30)
#endif
#if (USB_UVC_1080P_YUY2_EN)
// Interface Frame Uncompressed Descriptor ( 1920x1080 30fps )
YUY2_FRAME_DESC(0x0D, 1920, 1080, 30)
#endif
#if (USB_UVC_5M_EN)
// Interface Frame Uncompressed Descriptor ( 1024x768 30fps )
YUY2_FRAME_DESC(0x0E, 1024, 768, 30)

// Interface Frame Uncompressed Descriptor ( 1600x1200 30fps )
YUY2_FRAME_DESC(0x0F, 1600, 1200, 30)

// Interface Frame Uncompressed Descriptor ( 2048x1536 30fps )
YUY2_FRAME_DESC(0x10, 2048, 1536, 30)

// Interface Frame Uncompressed Descriptor ( 2592x1944 30fps )
YUY2_FRAME_DESC(0x11, 2592, 1944, 30)
#endif
#endif//end of (CUSTOMER == ASU)

#if (USING_STILL_METHOD_1 == 0)
//Interface Still Image Frame Descriptor
//YUY2_STILL_DESC(USB_UVC_YUY2_STILL_DESC_SIZE, NUM_YUY2_STILL, 640, 640>>8, 480, 480>>8, 320, 320>>8, 240, 240>>8, 160, 160>>8, 120, 120>>8)
YUY2_STILL_DESC(USB_UVC_YUY2_STILL_DESC_SIZE, NUM_YUY2_STILL, RES_LE(640,480), RES_LE(320,240), RES_LE(160,120))
#endif

// Interface Color Format
COLOR_DESC(1,1,4)

#endif	//ENABLE_YUY2

#endif  //  #if (SWAP_VIDEO_FORMAT_INDEX == 0)


// Interface Format MJPEG Descriptor
#if ENABLE_MJPEG

MJPEG_FORMAT_DESC(MJPEG_FORMAT_INDEX, NUM_D2_MJPG_VIDEO)
#if (CUSTOMER == ASU)
// Interface Frame MJPEG Descriptor ( 640x480 30fps )
MJPEG_FRAME_DESC(0x01, 640, 480, 0x100000, 30)

// Interface Frame MJPEG Descriptor ( 1280x720 30fps )
MJPEG_FRAME_DESC(0x02, 1280, 720, 0x100000, 30)

// Interface Frame MJPEG Descriptor ( 1280x960 30fps )
MJPEG_FRAME_DESC(0x03, 1280, 960, 0x100000, 30)

// Interface Frame MJPEG Descriptor ( 1920x1080 30fps )
MJPEG_FRAME_DESC(0x04, 1920, 1080, 0x100000, 30)

// Interface Frame MJPEG Descriptor ( 2592x1944 30fps )
MJPEG_FRAME_DESC(0x05, 2592, 1944, 0x100000, 15)

#else
// Interface Frame MJPEG Descriptor ( 1280x720 30fps )
MJPEG_FRAME_DESC(0x01, 1280, 720, 0x100000, 30)

// Interface Frame MJPEG Descriptor ( 160x120 30fps )
MJPEG_FRAME_DESC(0x02, 160, 120, 0x100000, 30)

// Interface Frame MJPEG Descriptor ( 320x240 30fps )
MJPEG_FRAME_DESC(0x03, 320, 240, 0x100000, 30)

// Interface Frame MJPEG Descriptor ( 640x360 30fps )
MJPEG_FRAME_DESC(0x04, 640, 360, 0x100000, 30)

// Interface Frame MJPEG Descriptor ( 384x216 30fps )
MJPEG_FRAME_DESC(0x05, 384, 216, 0x100000, 30)

// Interface Frame MJPEG Descriptor ( 352x288 30fps )
MJPEG_FRAME_DESC(0x06, 352, 288, 0x100000, 30)

// Interface Frame MJPEG Descriptor ( 640x480 30fps )
MJPEG_FRAME_DESC(0x07, 640, 480, 0x100000, 30)

// Interface Frame MJPEG Descriptor ( 960x720 30fps )
MJPEG_FRAME_DESC(0x08, 960, 720, 0x100000, 30)

// Interface Frame MJPEG Descriptor ( 912x512 30fps )
MJPEG_FRAME_DESC(0x09, 1024, 576, 0x100000, 30)

// Interface Frame MJPEG Descriptor ( 800x448 30fps )
MJPEG_FRAME_DESC(0x0A, 800, 448, 0x100000, 30)

// Interface Frame MJPEG Descriptor ( 800x600 30fps )
MJPEG_FRAME_DESC(0x0B, 800, 600, 0x100000, 30)

// Interface Frame MJPEG Descriptor ( 160x90 30fps )
MJPEG_FRAME_DESC(0x0C, 160, 90, 0x100000, 30)

// Interface Frame MJPEG Descriptor ( 320x180 30fps )
MJPEG_FRAME_DESC(0x0D, 320, 180, 0x100000, 30)


#if (USB_UVC_5M_EN) && (USB_UVC_1080P_MJPEG_EN)
// Interface Frame MJPEG Descriptor ( 1920x1080 30fps )
MJPEG_FRAME_DESC(0x0E, 1920, 1080, 0x100000, 30)

// Interface Frame MJPEG Descriptor ( 1280x960 30fps )
MJPEG_FRAME_DESC(0x0F, 1280, 960, 0x100000, 30)

// Interface Frame MJPEG Descriptor ( 1600x1200 30fps )
MJPEG_FRAME_DESC(0x10, 1600, 1200, 0x100000, 30)

// Interface Frame MJPEG Descriptor ( 2048x1536 30fps )
MJPEG_FRAME_DESC(0x11, 2048, 1536, 0x100000, 30)

// Interface Frame MJPEG Descriptor ( 2592x1944 30fps )
MJPEG_FRAME_DESC(0x12, 2592, 1944, 0x100000, 30)

#elif (USB_UVC_5M_EN)
// Interface Frame MJPEG Descriptor ( 1280x960 30fps )
MJPEG_FRAME_DESC(0x0E, 1280, 960, 0x100000, 30)

// Interface Frame MJPEG Descriptor ( 1600x1200 30fps )
MJPEG_FRAME_DESC(0x0F, 1600, 1200, 0x100000, 30)

// Interface Frame MJPEG Descriptor ( 2048x1536 30fps )
MJPEG_FRAME_DESC(0x10, 2048, 1536, 0x100000, 30)

// Interface Frame MJPEG Descriptor ( 2592x1944 30fps )
MJPEG_FRAME_DESC(0x11, 2592, 1944, 0x100000, 30)

#elif (USB_UVC_1080P_MJPEG_EN)
// Interface Frame MJPEG Descriptor ( 1920x1080 30fps )
MJPEG_FRAME_DESC(0x0E, 1920, 1080, 0x100000, 30)

#endif
#endif//end of (CUSTOMER == ASU)

#if (USING_STILL_METHOD_1 == 0)
//Interface Still Image Frame Descriptor
MJPEG_STILL_DESC(USB_UVC_MJPEG_STILL_DESC_SIZE, NUM_MJPG_STILL, \
                 RES_LE(1280, 720), RES_LE(640,480), RES_LE(640,360), RES_LE(320,240), RES_LE(320,180), RES_LE(160,120), RES_LE(160,90))
#endif

// Interface Color Format
COLOR_DESC(1,1,4)

#endif //ENABLE_MJPEG


#if (SWAP_VIDEO_FORMAT_INDEX)  // YUY2 index is 1, MJPEG index is 2

#if ENABLE_YUY2
// Interface Format Uncompressed Descriptor
// 32595559-0000-0010-8000-00AA00389B71  'YUY2' == MEDIASUBTYPE_YUY2
YUY2_FORMAT_DESC(YUY2_FORMAT_INDEX, NUM_D2_YUY2_VIDEO)


// Interface Frame Uncompressed Descriptor ( 640x480 30fps )
YUY2_FRAME_DESC(0x01, 640, 480, 30)

// Interface Frame Uncompressed Descriptor ( 160x120 30fps )
YUY2_FRAME_DESC(0x02, 160, 120, 30)

// Interface Frame Uncompressed Descriptor ( 320x240 30fps )
YUY2_FRAME_DESC(0x03, 320, 240, 30)

// Interface Frame Uncompressed Descriptor ( 640x360 30fps )
YUY2_FRAME_DESC(0x04, 640, 360, 30)

// Interface Frame Uncompressed Descriptor ( 384x216 30fps )
YUY2_FRAME_DESC(0x05, 384, 216, 30)

// Interface Frame Uncompressed Descriptor ( 352x288 30fps )
YUY2_FRAME_DESC(0x06, 352, 288, 30)

// Interface Frame Uncompressed Descriptor ( 1280x720 30fps )
YUY2_FRAME_DESC(0x07, 1280, 720, 30)

// Interface Frame Uncompressed Descriptor ( 960x720 30fps )
YUY2_FRAME_DESC(0x08, 960, 720, 30)

// Interface Frame Uncompressed Descriptor ( 272x144 30fps )
YUY2_FRAME_DESC(0x09, 272, 144, 30)

// Interface Frame Uncompressed Descriptor ( 368x208 30fps )
YUY2_FRAME_DESC(0x0A, 368, 208, 30)

// Interface Frame Uncompressed Descriptor ( 480x272 30fps )
YUY2_FRAME_DESC(0x0B, 480, 272, 30)

// Interface Frame Uncompressed Descriptor ( 624x352 30fps )
YUY2_FRAME_DESC(0x0C, 624, 352, 30)

// Interface Frame Uncompressed Descriptor ( 912x512 30fps )
YUY2_FRAME_DESC(0x0D, 912, 512, 30)

// Interface Frame Uncompressed Descriptor ( 800x448 30fps )
YUY2_FRAME_DESC(0x0E, 800, 448, 30)

// Interface Frame Uncompressed Descriptor ( 800x600 30fps )
YUY2_FRAME_DESC(0x0F, 800, 600, 30)

// Interface Frame Uncompressed Descriptor ( 960x544 30fps )
YUY2_FRAME_DESC(0x10, 960, 544, 30)

// Interface Frame Uncompressed Descriptor ( 160x90 30fps )
YUY2_FRAME_DESC(0x11, 160, 90, 30)

// Interface Frame Uncompressed Descriptor ( 320x180 30fps )
YUY2_FRAME_DESC(0x12, 320, 180, 30)

#if USB_UVC_1080P_EN
// Interface Frame Uncompressed Descriptor ( 1920x1080 30fps )
YUY2_FRAME_DESC(0x13, 1920, 1080, 30)
#endif

#if (USING_STILL_METHOD_1 == 0)
//Interface Still Image Frame Descriptor
YUY2_STILL_DESC(USB_UVC_YUY2_STILL_DESC_SIZE, NUM_YUY2_STILL, 640, 640>>8, 480, 480>>8, 320, 320>>8, 240, 240>>8, 160, 160>>8, 120, 120>>8)
#endif

// Interface Color Format
COLOR_DESC(1,1,4)

#endif	//ENABLE_YUY2

#endif  //  #if (SWAP_VIDEO_FORMAT_INDEX)



#if ENABLE_FRAME_BASE_H264
// Interface Format Uncompressed Descriptor
// 31544941-0000-0010-8000-00AA00389B71  'AIT1' == MEDIASUBTYPE_AIT1
// 0x34363248,0x0000,0x0010,0x80,0x00,0x00,0xAA,0x00,0x38,0x9B,0x71 //FOURCC H264
H264_FORMAT_DESC(FRAME_BASE_H264_INDEX, NUM_H264_VIDEO)

// Interface Frame Uncompressed Descriptor ( 1280x720 30fps )
H264_FRAME_DESC(1, 1280, 720, 30)

// Interface Frame Uncompressed Descriptor ( 640x480 30fps )
H264_FRAME_DESC(2, 640, 480, 30)

// Interface Frame Uncompressed Descriptor ( 320x240 30fps )
H264_FRAME_DESC(3, 320, 240, 30)

// Interface Frame Uncompressed Descriptor ( 160x120 30fps )
H264_FRAME_DESC(4, 160, 120, 30)

// Interface Frame Uncompressed Descriptor ( 160x90 30fps )
H264_FRAME_DESC(5, 160, 90, 30)

// Interface Frame Uncompressed Descriptor ( 320x180 30fps )
H264_FRAME_DESC(6, 320, 180, 30)

// Interface Frame Uncompressed Descriptor ( 640x360 30fps )
H264_FRAME_DESC(7, 640, 360, 30)

// Interface Frame Uncompressed Descriptor ( 480x270 30fps )
H264_FRAME_DESC(8, 480, 270, 30)

// Interface Frame Uncompressed Descriptor ( 800x450 30fps )
H264_FRAME_DESC(9, 800, 450, 30)

// Interface Frame Uncompressed Descriptor ( 1024x576 30fps )
H264_FRAME_DESC(10, 1024, 576, 30)

#if USB_UVC_1080P_EN
// Interface Frame Uncompressed Descriptor ( 1920x1080 30fps )
H264_FRAME_DESC(11, 1920, 1080, 30)
#endif

// Interface Color Format
COLOR_DESC(1,1,4)

#endif //ENABLE_FRAME_BASE_H264
#if USB_UVC_BULK_EP
#else
// *******************************************************
// Interface Descriptor
USB_IF_UVC_STREAM_DESC_SIZE,
0x004,
UVC_D2_STREAM_IF1_NO,// interface
0x001,// alt.
0x001,// eps
0x00E,// class:video class
SC_VIDEOSTREAMING,// sub-class:video streaming
0x000,
0x000,
#endif

// Endpoint Descriptor
USB_EP_DESC_SIZE,// 
0x005,// endpoint descriptor type
//0x081,// EP1
(0x80|PCCAM_TX1_EP_ADDR),
// Tx Type
#if USB_UVC_BULK_EP
0x002, // Bulk
// Max Packet Size
LOBYTE(HS_TX_MAX_PK_SIZE ),
HIBYTE(HS_TX_MAX_PK_SIZE ),
#else
0x005, // ISO
// Max Packet Size
LOBYTE(HS_TX_MAX_PK_SIZE | TX_ADD_FRAME_BITS(TX_PER_FRAME-1)),
HIBYTE(HS_TX_MAX_PK_SIZE | TX_ADD_FRAME_BITS(TX_PER_FRAME-1)),
#endif
// Interval
#if USB_UVC_BULK_EP
0x000,
#else
0x001,
#endif

#if SUPPORT_UAC
// *******************************************************
// Interface Association Descriptor
USB_IF_ASC_DESC_SIZE,
0x00B,
UAC_CTL_IF_NO,// first interface
NUM_OF_UAC_IF,// num of interface
0x001,// class:audio class
0x002,// sub-class:audio stream
0x000,
0x000,

// *******************************************************
// Interface Descriptor
USB_IF_UAC_CTL_DESC_SIZE,
0x004,
UAC_CTL_IF_NO,// interface
0x000,// alt.
0x000,
0x001,// class:audio class
0x001,// sub-class:audio control
0x000,
0x000,

// Interface Header Descriptor
USB_UAC_IF_CTL_HEADER_DESC_SIZE,
0x024,
0x001,// Header
0x000,// UAC Version 1.0 ( xp not support ver 2.0 )
0x001,
//0x026,// total size
//0x000,
LOBYTE(USB_UAC_IF_CTL_TOTAL_SIZE),      
HIBYTE(USB_UAC_IF_CTL_TOTAL_SIZE),      
0x001,// num of audio stream
UAC_STREAM_IF_NO,// interface of audio stream

// Interface Input Terminal Descriptor
USB_UAC_IF_CTL_IT_DESC_SIZE,
0x024,
0x002,// Input Terminal
0x001,// TID
0x001,// input type Microphone
0x002,
0x000,
AUDIN_CHANNEL,
#if AUDIN_CHANNEL==2
0x003,
#endif
#if AUDIN_CHANNEL==1
0x000,
#endif
0x000,
0x000,
0x000,

// Interface Output Terminal Descriptor
USB_UAC_IF_CTL_OT_DESC_SIZE,
0x024,
0x003,// Output Terminal
0x003,// TID
0x001,// output type streaming
0x001,
0x000,// assoc TID ( 0 or 1? )
0x005,// src ID
0x000,

// Interface Feature Unit Descriptor
USB_UAC_IF_CTL_FU_DESC_SIZE,
0x024,
0x006,// Feature Unit
0x005,// UID
0x001,// src ID
0x001,// num of control byte
0x003,// mute, volume
0x000,

// *******************************************************
// Interface Descriptor
USB_IF_UAC_STREAM_DESC_SIZE,
0x004,
UAC_STREAM_IF_NO,// interface
0x000,// alt.
0x000,
0x001,// class:audio class
0x002,// sub-class:audio streaming
0x000,
0x000,

// *******************************************************
// Interface Descriptor
USB_IF_UAC_STREAM_DESC_SIZE,
0x004,
UAC_STREAM_IF_NO,// interface
0x001,// alt.
0x001,// eps
0x001,// class:audio class
0x002,// sub-class:audio streaming
0x000,
0x000,

// Interface General Descriptor
USB_UAC_IF_STREAM_GENERAL_DESC_SIZE,
0x024,
0x001,// General
0x003,// endpoint link TID
0x002,//0x001,// delay ms ( num of frames )
0x001,// FormatTag, 1: PCM data format
0x000,

#if (CUSTOMER == LIT) || (CUSTOMER == LGT)
UAC_PCM_FORMAT_DESC(USB_UAC_IF_STREAM_FORMAT_PCM_DESC_SIZE,AUDIN_CHANNEL,2,16,NUM_OF_UAC_SAMPLING_RATE\
,LESBYTE(16000),LOSBYTE(16000),HISBYTE(16000)\
/*,LESBYTE(24000),LOSBYTE(24000),HISBYTE(24000)\*/
)
#elif ((CUSTOMER == CCN)&&(MODEL == 1))
UAC_PCM_FORMAT_DESC(USB_UAC_IF_STREAM_FORMAT_PCM_DESC_SIZE,AUDIN_CHANNEL,2,16,NUM_OF_UAC_SAMPLING_RATE\
,LESBYTE(16000),LOSBYTE(16000),HISBYTE(16000)\
/*,LESBYTE(24000),LOSBYTE(24000),HISBYTE(24000)\*/
,LESBYTE(8000),LOSBYTE(8000),HISBYTE(8000)\
/*,LESBYTE(48000),LOSBYTE(48000),HISBYTE(48000)\*/
)
#elif ((CUSTOMER == CCN)&&(MODEL == 0))// || (CUSTOMER == SNO)
UAC_PCM_FORMAT_DESC(USB_UAC_IF_STREAM_FORMAT_PCM_DESC_SIZE,AUDIN_CHANNEL,2,16,NUM_OF_UAC_SAMPLING_RATE\
,LESBYTE(16000),LOSBYTE(16000),HISBYTE(16000)\
/*,LESBYTE(24000),LOSBYTE(24000),HISBYTE(24000)\*/
,LESBYTE(8000),LOSBYTE(8000),HISBYTE(8000)\
/*,LESBYTE(48000),LOSBYTE(48000),HISBYTE(48000)\*/
)
#elif (CUSTOMER == ANW)
UAC_PCM_FORMAT_DESC(USB_UAC_IF_STREAM_FORMAT_PCM_DESC_SIZE,AUDIN_CHANNEL,2,16,NUM_OF_UAC_SAMPLING_RATE\
,LESBYTE(16000),LOSBYTE(16000),HISBYTE(16000)\
,LESBYTE(8000),LOSBYTE(8000),HISBYTE(8000)\
)
#else
UAC_PCM_FORMAT_DESC(USB_UAC_IF_STREAM_FORMAT_PCM_DESC_SIZE,AUDIN_CHANNEL,2,16,NUM_OF_UAC_SAMPLING_RATE\
,LESBYTE(AUDIN_SAMPLERATE),LOSBYTE(AUDIN_SAMPLERATE),HISBYTE(AUDIN_SAMPLERATE)\
)
#endif

// Endpoint Descriptor
USB_UAC_EP_DESC_SIZE,
0x005,
//0x082,// EP2
(0x80 | PCCAM_AU_EP_ADDR ),
#if (UAC_SYNC_MODE_EN == 1)
0x0D,	// iso + sync
#else
0x005,// ISO + async
#endif
//AUDIO_PACKET_SIZE(AUDIN_SAMPLERATE,AUDIN_CHANNEL),
(AU_EP_MAX_PK_SIZE_HS & 0xFF),
(AU_EP_MAX_PK_SIZE_HS >> 8),

0x004,// 4 packets per frame
0x000,
0x000,

// Endpoint General Descriptor
USB_UAC_EP_GENERAL_DESC_SIZE,
0x025,
0x001,// General
0x001,// pitch control
0x000,
0x000,
0x000,
#endif  // end of #if SUPPORT_UAC

};
#endif //(SUPPORT_SWITCH_CAMERA)

MMP_UBYTE   CONFIG_DESCRIPTOR_DATA1[CONFIG_DESCRIPTOR_LEN] =
{
// configuration descriptor
USB_CFG_DESC_SIZE,
0x002,
LOBYTE(CONFIG_DESCRIPTOR_LEN),      
HIBYTE(CONFIG_DESCRIPTOR_LEN),      
NUM_OF_TOTAL_IF,// num of interface

0x001,
0x000,
0x080,
0x0FA,                    

// *******************************************************
// Interface Association Descriptor
USB_IF_ASC_DESC_SIZE,
0x00B,
UVC_D1_CTL_IF_NO,// first interface
NUM_OF_UVC_D1_IF,// num of interface
0x00E,// class:video class
0x003,// sub-class:video interface collection 
0x000,
0x002,//device 1 product name
// *******************************************************
// Interface Descriptor
USB_IF_UVC_CTL_DESC_SIZE,
0x004,
UVC_D1_CTL_IF_NO,// interface
0x000,// alt.
0x001,//number of endpoints in this interface
0x00E,// class:video class
SC_VIDEOCONTROL, //0x001,// sub-class:video control
0x000,
0x002,//device 1 product name

// VC Interface Descriptor
USB_UVC_IF_CTL_HEADER_DESC_SIZE,
CS_INTERFACE,//0x024,
VC_HEADER,//0x001,// Header
0x000,// UVC Version 1.0 ( xp not support ver 1.1 )
0x001,
USB_UVC_IF_CTL_TOTAL_SIZE,
0x00,
LESBYTE(300000*1000),// sys clock - 300MHZ
LOSBYTE(300000*1000),
HISBYTE(300000*1000),
MSSBYTE(300000*1000),
NUM_OF_UVC_D1_STREAM_IF,// num of video stream
UVC_D1_STREAM_IF1_NO,// interface of video stream
//reserved for video stream 2


#if SKYPE_UVC_H264
// Interface Output Terminal Descriptor
VC_OT_DESC(UVC_OT_ID, UVC_EU3_ID)  // TID = 0x04, src ID = 0x02

// {A29E7641-DE04-47E3-8B2B-F4341AFF003B} for USBIF UVC 1.1 for H.264 Payload
VC_XU_DESC(UVC_EU3_ID, UVC_EU2_ID, UVC_EU3_GUID, 0x0B, 0x7F07)
#else
// Interface Output Terminal Descriptor
VC_OT_DESC(UVC_OT_ID, UVC_EU2_ID)  // TID = 0x04, src ID = 0x02
#endif

// Interface Extension Unit Descriptor
// {2C49D16A-32B8-4485-3EA8-643A152362F2} for LGT
#if (CUSTOMER == ASU)
//VC_XU_DESC(UVC_EU2_ID, UVC_EU1_ID, UVC_EU2_GUID, 0x05, 0x001F)
VC_XU_DESC(UVC_EU2_ID, UVC_EU1_ID, UVC_EU2_GUID, 0x01, 0x0001)
#else
VC_XU_DESC(UVC_EU2_ID, UVC_EU1_ID, UVC_EU2_GUID, 0x06, 0x003F)
#endif


// Interface Extension Unit Descriptor
// {23E49ED0-1178-4f31-AE52-D2FB8A8D3B48} for AIT XU
#if (CUSTOMER == CCN) || (CUSTOMER == LON) || (CUSTOMER == ASU)
    #if SECS_VER > 0
    VC_XU_DESC(UVC_EU1_ID, UVC_EU0_ID, UVC_EU1_GUID, 0x05, 0xEFFF)
    #else
    VC_XU_DESC(UVC_EU1_ID, UVC_PU_ID, UVC_EU1_GUID, 0x05, 0xEFFF)
    #endif
#else
    #if SECS_VER > 0
    VC_XU_DESC(UVC_EU1_ID, UVC_EU0_ID, UVC_EU1_GUID, 0x05, 0x6FFF)
    #else
    VC_XU_DESC(UVC_EU1_ID, UVC_PU_ID, UVC_EU1_GUID, 0x05, 0x6FFF)
    #endif
#endif

#if (SECS_VER > 0)
// Interface Extension Unit Descriptor
// {B42153BD-35D6-45CA-B203-4E0149B301BC} for Skype API
VC_SKYPE_XU_DESC(UVC_EU0_ID, UVC_PU_ID, UVC_EU0_GUID, 0x20, 0x0380019F)
#endif

// Interface Input(Camera) Terminal Descriptor
VC_IT_DESC(UVC_IT_ID,UVC_D1_IT_BITMAP)

// Interface Processing Unit Descriptor
VC_PU_DESC(UVC_PU_ID,UVC_IT_ID,UVC_D1_PU_BITMAP)

// Endpoint Descriptor
USB_EP_DESC_SIZE,
0x005,
(0x80|PCCAM_EX_EP_ADDR),// EP3
0x003,// INT
EX_EP_MAX_PK_SIZE,//0x008,// size
0x000,
0x008,//0x004,// interval

// Endpoint Interrupt Descriptor
USB_UVC_EP_INT_DESC_SIZE,
0x025,
0x003,// interrupt
EX_EP_MAX_PK_SIZE,//0x008,// size
0x000,

// *******************************************************
// Interface Descriptor
USB_IF_UVC_STREAM_DESC_SIZE,
0x004,
UVC_D1_STREAM_IF1_NO,// interface
0x000,// alt.
#if USB_UVC_BULK_EP
0x001,// eps
#else
0x000,// eps
#endif
0x00E,// class:video class
SC_VIDEOSTREAMING,// sub-class:video streaming
0x000,
0x000,

// Interface Input Header Descriptor
0x00D
#if ENABLE_YUY2
+0x01
#endif
#ifdef ENABLE_UYVY
+0x01
#endif
#ifdef ENABLE_NV12
+0x01
#endif
#if ENABLE_MJPEG
+0x01
#endif
#if ENABLE_FRAME_BASE_H264 // FrameBaseH264
+0x01
#endif
#ifdef ENABLE_FRAME_BASE_AVC1
+0x01
#endif
,
CS_INTERFACE,//0x024,
VS_INPUT_HEADER,//0x001,// Input Header
#if ENABLE_YUY2
0x001 //total format
#else
0x000
#endif
#ifdef ENABLE_UYVY
+0x01
#endif
#ifdef ENABLE_NV12
+0x01
#endif
#if ENABLE_MJPEG
+0x01
#endif
#if ENABLE_FRAME_BASE_H264 // FrameBaseH264
+0x01
#endif
#ifdef ENABLE_FRAME_BASE_AVC1
+0x01
#endif
,

LOBYTE(UVC_D1_INPUT_HEADER_LENGTH),      
HIBYTE(UVC_D1_INPUT_HEADER_LENGTH),      
(0x080|PCCAM_TX1_EP_ADDR),// video endpoint
0x000,
UVC_OT_ID, //0x004,//0x003,// linkID
#if USING_STILL_METHOD_1
0x000,//0x002, //0x001,//still method 1 //0x002,// still method 2
#else
0x002,//0x002, //0x001,//still method 1 //0x002,// still method 2
#endif
0x001,// Hardware still trigger support, 0: Not supported, 1: Supported
0x000,// Trigger usage, 0:Initiate still image capture, 1: General purpose button event
0x001,// bControlSize, size of each bmaControls(x) field, in bytes
#if ENABLE_YUY2
0x000,
#endif
#ifdef ENABLE_UYVY
0x000,
#endif
#ifdef ENABLE_NV12
0x000,
#endif
#if ENABLE_MJPEG
0x000,
#endif
#if ENABLE_FRAME_BASE_H264
0x000,
#endif
#ifdef ENABLE_FRAME_BASE_AVC1
0x000,
#endif


#if (SWAP_VIDEO_FORMAT_INDEX == 0)  // YUY2 index is 1, MJPEG index is 2

#if ENABLE_YUY2
// Interface Format Uncompressed Descriptor
// 32595559-0000-0010-8000-00AA00389B71  'YUY2' == MEDIASUBTYPE_YUY2
YUY2_FORMAT_DESC(YUY2_FORMAT_INDEX, NUM_D1_YUY2_VIDEO)

#if (CUSTOMER == ASU)
// Interface Frame Uncompressed Descriptor ( 640x480 30fps )
YUY2_FRAME_DESC(0x01, 640, 480, 30)
#elif (CUSTOMER == QDR)
// Interface Frame Uncompressed Descriptor ( 640x480 30fps )
YUY2_FRAME_DESC(0x01, 640, 480, 30)

// Interface Frame Uncompressed Descriptor ( 160x120 30fps )
YUY2_FRAME_DESC(0x02, 160, 120, 30)

// Interface Frame Uncompressed Descriptor ( 320x240 30fps )
YUY2_FRAME_DESC(0x03, 320, 240, 30)

// Interface Frame Uncompressed Descriptor ( 640x360 30fps )
YUY2_FRAME_DESC(0x04, 640, 360, 30)
#if NUM_D1_YUY2_VIDEO > 6
// Interface Frame Uncompressed Descriptor ( 1280x720 30fps )
YUY2_FRAME_DESC(0x05, 1280, 720, 30)

// Interface Frame Uncompressed Descriptor ( 960x720 30fps )
YUY2_FRAME_DESC(0x06, 960, 720, 30)

// Interface Frame Uncompressed Descriptor ( 800x600 30fps )
YUY2_FRAME_DESC(0x07, 800, 600, 30)

// Interface Frame Uncompressed Descriptor ( 160x90 30fps )
YUY2_FRAME_DESC(0x08, 160, 90, 30)

// Interface Frame Uncompressed Descriptor ( 320x180 30fps )
YUY2_FRAME_DESC(0x09, 320, 180, 30)
#endif
#else
// Interface Frame Uncompressed Descriptor ( 640x480 15fps )
YUY2_FRAME_DESC(0x01, 640, 480, 15)

/*
// Interface Frame Uncompressed Descriptor ( 160x120 30fps )
YUY2_FRAME_DESC(0x02, 160, 120, 30)

// Interface Frame Uncompressed Descriptor ( 320x240 30fps )
YUY2_FRAME_DESC(0x03, 320, 240, 30)

// Interface Frame Uncompressed Descriptor ( 640x360 30fps )
YUY2_FRAME_DESC(0x04, 640, 360, 30)

// Interface Frame Uncompressed Descriptor ( 384x216 30fps )
YUY2_FRAME_DESC(0x05, 384, 216, 30)

// Interface Frame Uncompressed Descriptor ( 352x288 30fps )
YUY2_FRAME_DESC(0x06, 352, 288, 30)
*/
#if NUM_D1_YUY2_VIDEO > 6
// Interface Frame Uncompressed Descriptor ( 1280x720 30fps )
YUY2_FRAME_DESC(0x07, 1280, 720, 30)

// Interface Frame Uncompressed Descriptor ( 960x720 30fps )
YUY2_FRAME_DESC(0x08, 960, 720, 30)

// Interface Frame Uncompressed Descriptor ( 800x448 30fps )
YUY2_FRAME_DESC(0x09, 800, 448, 30)

// Interface Frame Uncompressed Descriptor ( 800x600 30fps )
YUY2_FRAME_DESC(0x0A, 800, 600, 30)

// Interface Frame Uncompressed Descriptor ( 160x90 30fps )
YUY2_FRAME_DESC(0x0B, 160, 90, 30)

// Interface Frame Uncompressed Descriptor ( 320x180 30fps )
YUY2_FRAME_DESC(0x0C, 320, 180, 30)
#endif
#if (SUPPORT_DUAL_DEVICE==0) && (SUPPORT_SWITCH_CAMERA==0)//not use for ASUS ov9726
#if (USB_UVC_1080P_YUY2_EN)
// Interface Frame Uncompressed Descriptor ( 1920x1080 30fps )
YUY2_FRAME_DESC(0x0D, 1920, 1080, 30)
#endif
#if (USB_UVC_5M_EN)
// Interface Frame Uncompressed Descriptor ( 1024x768 30fps )
YUY2_FRAME_DESC(0x0E, 1024, 768, 30)

// Interface Frame Uncompressed Descriptor ( 1600x1200 30fps )
YUY2_FRAME_DESC(0x0F, 1600, 1200, 30)

// Interface Frame Uncompressed Descriptor ( 2048x1536 30fps )
YUY2_FRAME_DESC(0x10, 2048, 1536, 30)

// Interface Frame Uncompressed Descriptor ( 2592x1944 30fps )
YUY2_FRAME_DESC(0x11, 2592, 1944, 30)
#endif
#endif
#endif//end of (CUSTOMER == ASU)

#if (USING_STILL_METHOD_1 == 0)
//Interface Still Image Frame Descriptor
//YUY2_STILL_DESC(USB_UVC_YUY2_STILL_DESC_SIZE, NUM_YUY2_STILL, 640, 640>>8, 480, 480>>8, 320, 320>>8, 240, 240>>8, 160, 160>>8, 120, 120>>8)
YUY2_STILL_DESC(USB_UVC_YUY2_STILL_DESC_SIZE, NUM_YUY2_STILL, RES_LE(640,480), RES_LE(320,240), RES_LE(160,120))
#endif

// Interface Color Format
COLOR_DESC(1,1,4)

#endif	//ENABLE_YUY2

#endif  //  #if (SWAP_VIDEO_FORMAT_INDEX == 0)


// Interface Format MJPEG Descriptor
#if ENABLE_MJPEG

MJPEG_FORMAT_DESC(MJPEG_FORMAT_INDEX, NUM_D1_MJPG_VIDEO)
#if (CUSTOMER == ASU)
// Interface Frame MJPEG Descriptor ( 640x480 30fps )
MJPEG_FRAME_DESC(0x01, 640, 480, 0x100000, 30)

// Interface Frame MJPEG Descriptor ( 1280x720 30fps )
MJPEG_FRAME_DESC(0x02, 1280, 720, 0x100000, 30)
#elif (CUSTOMER == QDR)
#if BIND_SENSOR_AR0832E
// Interface Frame MJPEG Descriptor ( 640x480 30fps )
MJPEG_FRAME_DESC(0x01, 640, 480, 0x100000, 15)
// Interface Frame MJPEG Descriptor ( 1280x720 30fps )
MJPEG_FRAME_DESC(0x02, 1280, 720, 0x100000, 15)
// Interface Frame MJPEG Descriptor ( 1280x960 30fps )
MJPEG_FRAME_DESC(0x03, 1280, 960, 0x100000, 15)
// Interface Frame MJPEG Descriptor ( 1920x1080 30fps )
MJPEG_FRAME_DESC(0x04, 1920, 1080, 0x100000, 15)
// Interface Frame MJPEG Descriptor ( 2048x1536 15fps )
MJPEG_FRAME_DESC(0x05, 2048, 1536, 0x100000, 15)
// Interface Frame MJPEG Descriptor ( 2592x1944 15fps )
MJPEG_FRAME_DESC(0x06, 2592, 1944, 0x100000, 15)
#else
// Interface Frame MJPEG Descriptor ( 1280x720 30fps )
MJPEG_FRAME_DESC(0x01, 1280, 720, 0x100000, 30)

// Interface Frame MJPEG Descriptor ( 160x120 30fps )
MJPEG_FRAME_DESC(0x02, 160, 120, 0x100000, 30)

// Interface Frame MJPEG Descriptor ( 320x240 30fps )
MJPEG_FRAME_DESC(0x03, 320, 240, 0x100000, 30)

// Interface Frame MJPEG Descriptor ( 640x360 30fps )
MJPEG_FRAME_DESC(0x04, 640, 360, 0x100000, 30)

// Interface Frame MJPEG Descriptor ( 640x480 30fps )
MJPEG_FRAME_DESC(0x05, 640, 480, 0x100000, 30)

// Interface Frame MJPEG Descriptor ( 960x720 30fps )
MJPEG_FRAME_DESC(0x06, 960, 720, 0x100000, 30)

// Interface Frame MJPEG Descriptor ( 800x600 30fps )
MJPEG_FRAME_DESC(0x07, 800, 600, 0x100000, 30)

// Interface Frame MJPEG Descriptor ( 160x90 30fps )
MJPEG_FRAME_DESC(0x08, 160, 90, 0x100000, 30)

// Interface Frame MJPEG Descriptor ( 320x180 30fps )
MJPEG_FRAME_DESC(0x09, 320, 180, 0x100000, 30)

// Interface Frame MJPEG Descriptor ( 480x270 30fps )
MJPEG_FRAME_DESC(0x0A, 480, 270, 0x100000, 30)

// Interface Frame MJPEG Descriptor ( 800x450 30fps )
MJPEG_FRAME_DESC(0x0B, 800, 450, 0x100000, 30)

// Interface Frame MJPEG Descriptor ( 1024x576 30fps )
MJPEG_FRAME_DESC(0x0C, 1024, 576, 0x100000, 30)

#if BIND_SENSOR_AR0330
// Interface Frame MJPEG Descriptor ( 2304x1296 30fps )
MJPEG_FRAME_DESC(0x0D, 2304, 1296, 0x100000, 30)
#endif
#endif
#else
// Interface Frame MJPEG Descriptor ( 160x120 30fps )
MJPEG_FRAME_DESC(0x01, 160, 120, 0x100000, 30)

// Interface Frame MJPEG Descriptor ( 1280x720 30fps )
MJPEG_FRAME_DESC(0x02, 1280, 720, 0x100000, 30)

// Interface Frame MJPEG Descriptor ( 320x240 30fps )
MJPEG_FRAME_DESC(0x03, 320, 240, 0x100000, 30)

// Interface Frame MJPEG Descriptor ( 640x360 30fps )
MJPEG_FRAME_DESC(0x04, 640, 360, 0x100000, 30)

// Interface Frame MJPEG Descriptor ( 384x216 30fps )
MJPEG_FRAME_DESC(0x05, 384, 216, 0x100000, 30)

// Interface Frame MJPEG Descriptor ( 352x288 30fps )
MJPEG_FRAME_DESC(0x06, 352, 288, 0x100000, 30)

// Interface Frame MJPEG Descriptor ( 640x480 30fps )
MJPEG_FRAME_DESC(0x07, 640, 480, 0x100000, 30)

// Interface Frame MJPEG Descriptor ( 960x720 30fps )
MJPEG_FRAME_DESC(0x08, 960, 720, 0x100000, 30)

// Interface Frame MJPEG Descriptor ( 912x512 30fps )
MJPEG_FRAME_DESC(0x09, 1024, 576, 0x100000, 30)

// Interface Frame MJPEG Descriptor ( 800x448 30fps )
MJPEG_FRAME_DESC(0x0A, 800, 448, 0x100000, 30)

// Interface Frame MJPEG Descriptor ( 800x600 30fps )
MJPEG_FRAME_DESC(0x0B, 800, 600, 0x100000, 30)

// Interface Frame MJPEG Descriptor ( 160x90 30fps )
MJPEG_FRAME_DESC(0x0C, 160, 90, 0x100000, 30)

// Interface Frame MJPEG Descriptor ( 320x180 30fps )
MJPEG_FRAME_DESC(0x0D, 320, 180, 0x100000, 30)

#if (SUPPORT_DUAL_DEVICE==0) && (SUPPORT_SWITCH_CAMERA==0)//not use for ASUS ov9726
#if (USB_UVC_5M_EN) && (USB_UVC_1080P_MJPEG_EN)
// Interface Frame MJPEG Descriptor ( 1920x1080 30fps )
MJPEG_FRAME_DESC(0x0E, 1920, 1080, 0x100000, 30)

// Interface Frame MJPEG Descriptor ( 1280x960 30fps )
MJPEG_FRAME_DESC(0x0F, 1280, 960, 0x100000, 30)

// Interface Frame MJPEG Descriptor ( 1600x1200 30fps )
MJPEG_FRAME_DESC(0x10, 1600, 1200, 0x100000, 30)

// Interface Frame MJPEG Descriptor ( 2048x1536 30fps )
MJPEG_FRAME_DESC(0x11, 2048, 1536, 0x100000, 30)

// Interface Frame MJPEG Descriptor ( 2592x1944 30fps )
MJPEG_FRAME_DESC(0x12, 2592, 1944, 0x100000, 30)

#elif (USB_UVC_5M_EN)
// Interface Frame MJPEG Descriptor ( 1280x960 30fps )
MJPEG_FRAME_DESC(0x0E, 1280, 960, 0x100000, 30)

// Interface Frame MJPEG Descriptor ( 1600x1200 30fps )
MJPEG_FRAME_DESC(0x0F, 1600, 1200, 0x100000, 30)

// Interface Frame MJPEG Descriptor ( 2048x1536 30fps )
MJPEG_FRAME_DESC(0x10, 2048, 1536, 0x100000, 30)

// Interface Frame MJPEG Descriptor ( 2592x1944 30fps )
MJPEG_FRAME_DESC(0x11, 2592, 1944, 0x100000, 30)

#elif (USB_UVC_1080P_MJPEG_EN)
// Interface Frame MJPEG Descriptor ( 1920x1080 30fps )
MJPEG_FRAME_DESC(0x0E, 1920, 1080, 0x100000, 30)

#endif
#endif//(SUPPORT_DUAL_DEVICE==0) && (SUPPORT_SWITCH_CAMERA==0)
#endif//end of (CUSTOMER == ASU)
#if (USING_STILL_METHOD_1 == 0)
//Interface Still Image Frame Descriptor
#if BIND_SENSOR_AR0330
MJPEG_STILL_DESC(USB_UVC_MJPEG_STILL_DESC_SIZE, NUM_MJPG_STILL, \
                 RES_LE(1280, 720), RES_LE(640,480), RES_LE(640,360), RES_LE(320,240), RES_LE(320,180), RES_LE(160,120), RES_LE(160,90), RES_LE(1920,1080), RES_LE(2304,1296))
#elif BIND_SENSOR_AR0832E
MJPEG_STILL_DESC(USB_UVC_MJPEG_STILL_DESC_SIZE, NUM_MJPG_STILL, \
                 RES_LE(2592, 1944), RES_LE(2048,1536), RES_LE(1920,1080), RES_LE(1280,960), RES_LE(1280,720), RES_LE(640,480))
#else
MJPEG_STILL_DESC(USB_UVC_MJPEG_STILL_DESC_SIZE, NUM_MJPG_STILL, \
                 RES_LE(1280, 720), RES_LE(640,480), RES_LE(640,360), RES_LE(320,240), RES_LE(320,180), RES_LE(160,120), RES_LE(160,90))
#endif
#endif

// Interface Color Format
COLOR_DESC(1,1,4)

#endif //ENABLE_MJPEG



#if (SWAP_VIDEO_FORMAT_INDEX)  // YUY2 index is 1, MJPEG index is 2

#if ENABLE_YUY2
// Interface Format Uncompressed Descriptor
// 32595559-0000-0010-8000-00AA00389B71  'YUY2' == MEDIASUBTYPE_YUY2
YUY2_FORMAT_DESC(YUY2_FORMAT_INDEX, NUM_D1_YUY2_VIDEO)


// Interface Frame Uncompressed Descriptor ( 640x480 30fps )
YUY2_FRAME_DESC(0x01, 640, 480, 30)

// Interface Frame Uncompressed Descriptor ( 160x120 30fps )
YUY2_FRAME_DESC(0x02, 160, 120, 30)

// Interface Frame Uncompressed Descriptor ( 320x240 30fps )
YUY2_FRAME_DESC(0x03, 320, 240, 30)

// Interface Frame Uncompressed Descriptor ( 640x360 30fps )
YUY2_FRAME_DESC(0x04, 640, 360, 30)

// Interface Frame Uncompressed Descriptor ( 384x216 30fps )
YUY2_FRAME_DESC(0x05, 384, 216, 30)

// Interface Frame Uncompressed Descriptor ( 352x288 30fps )
YUY2_FRAME_DESC(0x06, 352, 288, 30)

// Interface Frame Uncompressed Descriptor ( 1280x720 30fps )
YUY2_FRAME_DESC(0x07, 1280, 720, 30)

// Interface Frame Uncompressed Descriptor ( 960x720 30fps )
YUY2_FRAME_DESC(0x08, 960, 720, 30)

// Interface Frame Uncompressed Descriptor ( 272x144 30fps )
YUY2_FRAME_DESC(0x09, 272, 144, 30)

// Interface Frame Uncompressed Descriptor ( 368x208 30fps )
YUY2_FRAME_DESC(0x0A, 368, 208, 30)

// Interface Frame Uncompressed Descriptor ( 480x272 30fps )
YUY2_FRAME_DESC(0x0B, 480, 272, 30)

// Interface Frame Uncompressed Descriptor ( 624x352 30fps )
YUY2_FRAME_DESC(0x0C, 624, 352, 30)

// Interface Frame Uncompressed Descriptor ( 912x512 30fps )
YUY2_FRAME_DESC(0x0D, 912, 512, 30)

// Interface Frame Uncompressed Descriptor ( 800x448 30fps )
YUY2_FRAME_DESC(0x0E, 800, 448, 30)

// Interface Frame Uncompressed Descriptor ( 800x600 30fps )
YUY2_FRAME_DESC(0x0F, 800, 600, 30)

// Interface Frame Uncompressed Descriptor ( 960x544 30fps )
YUY2_FRAME_DESC(0x10, 960, 544, 30)

// Interface Frame Uncompressed Descriptor ( 160x90 30fps )
YUY2_FRAME_DESC(0x11, 160, 90, 30)

// Interface Frame Uncompressed Descriptor ( 320x180 30fps )
YUY2_FRAME_DESC(0x12, 320, 180, 30)

#if USB_UVC_1080P_EN
// Interface Frame Uncompressed Descriptor ( 1920x1080 30fps )
YUY2_FRAME_DESC(0x13, 1920, 1080, 30)
#endif

#if (USING_STILL_METHOD_1 == 0)
//Interface Still Image Frame Descriptor
YUY2_STILL_DESC(USB_UVC_YUY2_STILL_DESC_SIZE, NUM_YUY2_STILL, 640, 640>>8, 480, 480>>8, 320, 320>>8, 240, 240>>8, 160, 160>>8, 120, 120>>8)
#endif

// Interface Color Format
COLOR_DESC(1,1,4)

#endif	//ENABLE_YUY2

#endif  //  #if (SWAP_VIDEO_FORMAT_INDEX)


#if ENABLE_FRAME_BASE_H264
// Interface Format Uncompressed Descriptor
// 31544941-0000-0010-8000-00AA00389B71  'AIT1' == MEDIASUBTYPE_AIT1
// 0x34363248,0x0000,0x0010,0x80,0x00,0x00,0xAA,0x00,0x38,0x9B,0x71 //FOURCC H264
H264_FORMAT_DESC(FRAME_BASE_H264_INDEX, NUM_H264_VIDEO)

// Interface Frame Uncompressed Descriptor ( 1280x720 30fps )
H264_FRAME_DESC(1, 1280, 720, 30)

// Interface Frame Uncompressed Descriptor ( 640x480 30fps )
H264_FRAME_DESC(2, 640, 480, 30)

// Interface Frame Uncompressed Descriptor ( 320x240 30fps )
H264_FRAME_DESC(3, 320, 240, 30)

// Interface Frame Uncompressed Descriptor ( 160x120 30fps )
H264_FRAME_DESC(4, 160, 120, 30)

// Interface Frame Uncompressed Descriptor ( 160x90 30fps )
H264_FRAME_DESC(5, 160, 90, 30)

// Interface Frame Uncompressed Descriptor ( 320x180 30fps )
H264_FRAME_DESC(6, 320, 180, 30)

// Interface Frame Uncompressed Descriptor ( 640x360 30fps )
H264_FRAME_DESC(7, 640, 360, 30)

// Interface Frame Uncompressed Descriptor ( 480x270 30fps )
H264_FRAME_DESC(8, 480, 270, 30)

// Interface Frame Uncompressed Descriptor ( 800x450 30fps )
H264_FRAME_DESC(9, 800, 450, 30)

// Interface Frame Uncompressed Descriptor ( 1024x576 30fps )
H264_FRAME_DESC(10, 1024, 576, 30)

#if USB_UVC_1080P_EN
// Interface Frame Uncompressed Descriptor ( 1920x1080 30fps )
H264_FRAME_DESC(11, 1920, 1080, 30)
#endif

// Interface Color Format
COLOR_DESC(1,1,4)

#endif //ENABLE_FRAME_BASE_H264



#if USB_UVC_BULK_EP
#else
// *******************************************************
// Interface Descriptor
USB_IF_UVC_STREAM_DESC_SIZE,
0x004,
UVC_D1_STREAM_IF1_NO,// interface
0x001,// alt.
0x001,// eps
0x00E,// class:video class
SC_VIDEOSTREAMING,// sub-class:video streaming
0x000,
0x000,
#endif

// Endpoint Descriptor
USB_EP_DESC_SIZE,// 
0x005,// endpoint descriptor type
//0x081,// EP1
(0x80|PCCAM_TX1_EP_ADDR),
#if USB_UVC_BULK_EP
0x002,// BULK
#else
0x005,// ISO
#endif
// MaxPkSize
LOBYTE(FS_TX_MAX_PK_SIZE),
HIBYTE(FS_TX_MAX_PK_SIZE),
// Interval
#if USB_UVC_BULK_EP
0x000,
#else
0x001,
#endif
#if SUPPORT_DUAL_DEVICE
// *******************************************************
// Interface Association Descriptor
USB_IF_ASC_DESC_SIZE,
0x00B,
UVC_D2_CTL_IF_NO,// first interface
NUM_OF_UVC_D2_IF,// num of interface
0x00E,// class:video class
0x003,// sub-class:video interface collection 
0x000,
0x004,//device 2 product name
// *******************************************************
// Interface Descriptor
USB_IF_UVC_CTL_DESC_SIZE,
0x004,
UVC_D2_CTL_IF_NO,// interface
0x000,// alt.
0x001,//number of endpoints in this interface
0x00E,// class:video class
SC_VIDEOCONTROL, //0x001,// sub-class:video control
0x000,
0x000,

// VC Interface Descriptor
USB_UVC_IF_CTL_HEADER_DESC_SIZE,
CS_INTERFACE,//0x024,
VC_HEADER,//0x001,// Header
0x000,// UVC Version 1.0 ( xp not support ver 1.1 )
0x001,
USB_UVC_IF_CTL_TOTAL_SIZE,
0x00,
LESBYTE(300000*1000),// sys clock - 300MHZ
LOSBYTE(300000*1000),
HISBYTE(300000*1000),
MSSBYTE(300000*1000),
NUM_OF_UVC_D2_STREAM_IF,// num of video stream
UVC_D2_STREAM_IF1_NO,// interface of video stream
//reserved for video stream 2


#if SKYPE_UVC_H264
// Interface Output Terminal Descriptor
VC_OT_DESC(UVC_OT_ID, UVC_EU3_ID)  // TID = 0x04, src ID = 0x02

// {A29E7641-DE04-47E3-8B2B-F4341AFF003B} for USBIF UVC 1.1 for H.264 Payload
VC_XU_DESC(UVC_EU3_ID, UVC_EU2_ID, UVC_EU3_GUID, 0x0B, 0x7F07)
#else
// Interface Output Terminal Descriptor
VC_OT_DESC(UVC_OT_ID, UVC_EU2_ID)  // TID = 0x04, src ID = 0x02
#endif

// Interface Extension Unit Descriptor
// {2C49D16A-32B8-4485-3EA8-643A152362F2} for LGT
#if (CUSTOMER == ASU)
VC_XU_DESC(UVC_EU2_ID, UVC_EU1_ID, UVC_EU2_GUID, 0x01, 0x0001)
#else
VC_XU_DESC(UVC_EU2_ID, UVC_EU1_ID, UVC_EU2_GUID, 0x06, 0x003F)
#endif


// Interface Extension Unit Descriptor
// {23E49ED0-1178-4f31-AE52-D2FB8A8D3B48} for AIT XU
#if (CUSTOMER == CCN) || (CUSTOMER == LON) || (CUSTOMER == ASU)
    #if SECS_VER > 0
    VC_XU_DESC(UVC_EU1_ID, UVC_EU0_ID, UVC_EU1_GUID, 0x05, 0xEFFF)
    #else
    VC_XU_DESC(UVC_EU1_ID, UVC_PU_ID, UVC_EU1_GUID, 0x05, 0xEFFF)
    #endif
#else
    #if SECS_VER > 0
    VC_XU_DESC(UVC_EU1_ID, UVC_EU0_ID, UVC_EU1_GUID, 0x05, 0x6FFF)
    #else
    VC_XU_DESC(UVC_EU1_ID, UVC_PU_ID, UVC_EU1_GUID, 0x05, 0x6FFF)
    #endif
#endif

#if (SECS_VER > 0)
// Interface Extension Unit Descriptor
// {B42153BD-35D6-45CA-B203-4E0149B301BC} for Skype API
VC_SKYPE_XU_DESC(UVC_EU0_ID, UVC_PU_ID, UVC_EU0_GUID, 0x20, 0x0380019F)
#endif

// Interface Input(Camera) Terminal Descriptor
VC_IT_DESC(UVC_IT_ID,UVC_D2_IT_BITMAP)

// Interface Processing Unit Descriptor
VC_PU_DESC(UVC_PU_ID,UVC_IT_ID,UVC_D2_PU_BITMAP)

// Endpoint Descriptor
USB_EP_DESC_SIZE,
0x005,
(0x80|PCCAM_EX_EP_ADDR),// EP3
0x003,// INT
EX_EP_MAX_PK_SIZE,//0x008,// size
0x000,
0x008,//0x004,// interval

// Endpoint Interrupt Descriptor
USB_UVC_EP_INT_DESC_SIZE,
0x025,
0x003,// interrupt
EX_EP_MAX_PK_SIZE,//0x008,// size
0x000,

// *******************************************************
// Interface Descriptor
USB_IF_UVC_STREAM_DESC_SIZE,
0x004,
UVC_D2_STREAM_IF1_NO,// interface
0x000,// alt.
#if USB_UVC_BULK_EP
0x001,// eps
#else
0x000,// eps
#endif
0x00E,// class:video class
SC_VIDEOSTREAMING,// sub-class:video streaming
0x000,
0x000,

// Interface Input Header Descriptor
0x00D
#if ENABLE_YUY2
+0x01
#endif
#ifdef ENABLE_UYVY
+0x01
#endif
#ifdef ENABLE_NV12
+0x01
#endif
#if ENABLE_MJPEG
+0x01
#endif
#if ENABLE_FRAME_BASE_H264 // FrameBaseH264
+0x01
#endif
#ifdef ENABLE_FRAME_BASE_AVC1
+0x01
#endif
,
CS_INTERFACE,//0x024,
VS_INPUT_HEADER,//0x001,// Input Header
#if ENABLE_YUY2
0x001 //total format
#else
0x000
#endif
#ifdef ENABLE_UYVY
+0x01
#endif
#ifdef ENABLE_NV12
+0x01
#endif
#if ENABLE_MJPEG
+0x01
#endif
#if ENABLE_FRAME_BASE_H264 // FrameBaseH264
+0x01
#endif
#ifdef ENABLE_FRAME_BASE_AVC1
+0x01
#endif
,

LOBYTE(UVC_D2_INPUT_HEADER_LENGTH),      
HIBYTE(UVC_D2_INPUT_HEADER_LENGTH),      
(0x080|PCCAM_TX1_EP_ADDR),// video endpoint
0x000,
UVC_OT_ID, //0x004,//0x003,// linkID
#if USING_STILL_METHOD_1
0x000,//0x002, //0x001,//still method 1 //0x002,// still method 2
#else
0x002,//0x002, //0x001,//still method 1 //0x002,// still method 2
#endif
0x001,// Hardware still trigger support, 0: Not supported, 1: Supported
0x000,// Trigger usage, 0:Initiate still image capture, 1: General purpose button event
0x001,// bControlSize, size of each bmaControls(x) field, in bytes
#if ENABLE_YUY2
0x000,
#endif
#ifdef ENABLE_UYVY
0x000,
#endif
#ifdef ENABLE_NV12
0x000,
#endif
#if ENABLE_MJPEG
0x000,
#endif
#if ENABLE_FRAME_BASE_H264 
0x000,
#endif
#ifdef ENABLE_FRAME_BASE_AVC1
0x000,
#endif


#if (SWAP_VIDEO_FORMAT_INDEX == 0)  // YUY2 index is 1, MJPEG index is 2

#if ENABLE_YUY2
// Interface Format Uncompressed Descriptor
// 32595559-0000-0010-8000-00AA00389B71  'YUY2' == MEDIASUBTYPE_YUY2
YUY2_FORMAT_DESC(YUY2_FORMAT_INDEX, NUM_D2_YUY2_VIDEO)
#if (CUSTOMER == ASU)
// Interface Frame Uncompressed Descriptor ( 640x480 30fps )
YUY2_FRAME_DESC(0x01, 640, 480, 30)

#else
// Interface Frame Uncompressed Descriptor ( 640x480 30fps )
YUY2_FRAME_DESC(0x01, 640, 480, 30)

// Interface Frame Uncompressed Descriptor ( 160x120 30fps )
YUY2_FRAME_DESC(0x02, 160, 120, 30)

// Interface Frame Uncompressed Descriptor ( 320x240 30fps )
YUY2_FRAME_DESC(0x03, 320, 240, 30)

// Interface Frame Uncompressed Descriptor ( 640x360 30fps )
YUY2_FRAME_DESC(0x04, 640, 360, 30)

// Interface Frame Uncompressed Descriptor ( 384x216 30fps )
YUY2_FRAME_DESC(0x05, 384, 216, 30)

// Interface Frame Uncompressed Descriptor ( 352x288 30fps )
YUY2_FRAME_DESC(0x06, 352, 288, 30)

#if NUM_D2_YUY2_VIDEO > 6
// Interface Frame Uncompressed Descriptor ( 1280x720 30fps )
YUY2_FRAME_DESC(0x07, 1280, 720, 30)

// Interface Frame Uncompressed Descriptor ( 960x720 30fps )
YUY2_FRAME_DESC(0x08, 960, 720, 30)

// Interface Frame Uncompressed Descriptor ( 800x448 30fps )
YUY2_FRAME_DESC(0x09, 800, 448, 30)

// Interface Frame Uncompressed Descriptor ( 800x600 30fps )
YUY2_FRAME_DESC(0x0A, 800, 600, 30)

// Interface Frame Uncompressed Descriptor ( 160x90 30fps )
YUY2_FRAME_DESC(0x0B, 160, 90, 30)

// Interface Frame Uncompressed Descriptor ( 320x180 30fps )
YUY2_FRAME_DESC(0x0C, 320, 180, 30)
#endif
#if (USB_UVC_1080P_YUY2_EN)
// Interface Frame Uncompressed Descriptor ( 1920x1080 30fps )
YUY2_FRAME_DESC(0x0D, 1920, 1080, 30)
#endif
#if (USB_UVC_5M_EN)
// Interface Frame Uncompressed Descriptor ( 1024x768 30fps )
YUY2_FRAME_DESC(0x0E, 1024, 768, 30)

// Interface Frame Uncompressed Descriptor ( 1600x1200 30fps )
YUY2_FRAME_DESC(0x0F, 1600, 1200, 30)

// Interface Frame Uncompressed Descriptor ( 2048x1536 30fps )
YUY2_FRAME_DESC(0x10, 2048, 1536, 30)

// Interface Frame Uncompressed Descriptor ( 2592x1944 30fps )
YUY2_FRAME_DESC(0x11, 2592, 1944, 30)
#endif
#endif//end of (CUSTOMER == ASU)

#if (USING_STILL_METHOD_1 == 0)
//Interface Still Image Frame Descriptor
//YUY2_STILL_DESC(USB_UVC_YUY2_STILL_DESC_SIZE, NUM_YUY2_STILL, 640, 640>>8, 480, 480>>8, 320, 320>>8, 240, 240>>8, 160, 160>>8, 120, 120>>8)
YUY2_STILL_DESC(USB_UVC_YUY2_STILL_DESC_SIZE, NUM_YUY2_STILL, RES_LE(640,480), RES_LE(320,240), RES_LE(160,120))
#endif

// Interface Color Format
COLOR_DESC(1,1,4)

#endif	//ENABLE_YUY2

#endif  //  #if (SWAP_VIDEO_FORMAT_INDEX == 0)


// Interface Format MJPEG Descriptor
#if ENABLE_MJPEG

MJPEG_FORMAT_DESC(MJPEG_FORMAT_INDEX, NUM_D2_MJPG_VIDEO)
#if (CUSTOMER == ASU)
// Interface Frame MJPEG Descriptor ( 640x480 30fps )
MJPEG_FRAME_DESC(0x01, 640, 480, 0x100000, 30)

// Interface Frame MJPEG Descriptor ( 1280x720 30fps )
MJPEG_FRAME_DESC(0x02, 1280, 720, 0x100000, 30)

// Interface Frame MJPEG Descriptor ( 1280x960 30fps )
MJPEG_FRAME_DESC(0x03, 1280, 960, 0x100000, 30)

// Interface Frame MJPEG Descriptor ( 1920x1080 30fps )
MJPEG_FRAME_DESC(0x04, 1920, 1080, 0x100000, 30)

// Interface Frame MJPEG Descriptor ( 2592x1944 30fps )
MJPEG_FRAME_DESC(0x05, 2592, 1944, 0x100000, 15)

#else
// Interface Frame MJPEG Descriptor ( 160x120 30fps )
MJPEG_FRAME_DESC(0x01, 160, 120, 0x100000, 30)

// Interface Frame MJPEG Descriptor ( 1280x720 30fps )
MJPEG_FRAME_DESC(0x02, 1280, 720, 0x100000, 30)

// Interface Frame MJPEG Descriptor ( 320x240 30fps )
MJPEG_FRAME_DESC(0x03, 320, 240, 0x100000, 30)

// Interface Frame MJPEG Descriptor ( 640x360 30fps )
MJPEG_FRAME_DESC(0x04, 640, 360, 0x100000, 30)

// Interface Frame MJPEG Descriptor ( 384x216 30fps )
MJPEG_FRAME_DESC(0x05, 384, 216, 0x100000, 30)

// Interface Frame MJPEG Descriptor ( 352x288 30fps )
MJPEG_FRAME_DESC(0x06, 352, 288, 0x100000, 30)

// Interface Frame MJPEG Descriptor ( 640x480 30fps )
MJPEG_FRAME_DESC(0x07, 640, 480, 0x100000, 30)

// Interface Frame MJPEG Descriptor ( 960x720 30fps )
MJPEG_FRAME_DESC(0x08, 960, 720, 0x100000, 30)

// Interface Frame MJPEG Descriptor ( 912x512 30fps )
MJPEG_FRAME_DESC(0x09, 1024, 576, 0x100000, 30)

// Interface Frame MJPEG Descriptor ( 800x448 30fps )
MJPEG_FRAME_DESC(0x0A, 800, 448, 0x100000, 30)

// Interface Frame MJPEG Descriptor ( 800x600 30fps )
MJPEG_FRAME_DESC(0x0B, 800, 600, 0x100000, 30)

// Interface Frame MJPEG Descriptor ( 160x90 30fps )
MJPEG_FRAME_DESC(0x0C, 160, 90, 0x100000, 30)

// Interface Frame MJPEG Descriptor ( 320x180 30fps )
MJPEG_FRAME_DESC(0x0D, 320, 180, 0x100000, 30)


#if (USB_UVC_5M_EN) && (USB_UVC_1080P_MJPEG_EN)
// Interface Frame MJPEG Descriptor ( 1920x1080 30fps )
MJPEG_FRAME_DESC(0x0E, 1920, 1080, 0x100000, 30)

// Interface Frame MJPEG Descriptor ( 1280x960 30fps )
MJPEG_FRAME_DESC(0x0F, 1280, 960, 0x100000, 30)

// Interface Frame MJPEG Descriptor ( 1600x1200 30fps )
MJPEG_FRAME_DESC(0x10, 1600, 1200, 0x100000, 30)

// Interface Frame MJPEG Descriptor ( 2048x1536 30fps )
MJPEG_FRAME_DESC(0x11, 2048, 1536, 0x100000, 30)

// Interface Frame MJPEG Descriptor ( 2592x1944 30fps )
MJPEG_FRAME_DESC(0x12, 2592, 1944, 0x100000, 30)

#elif (USB_UVC_5M_EN)
// Interface Frame MJPEG Descriptor ( 1280x960 30fps )
MJPEG_FRAME_DESC(0x0E, 1280, 960, 0x100000, 30)

// Interface Frame MJPEG Descriptor ( 1600x1200 30fps )
MJPEG_FRAME_DESC(0x0F, 1600, 1200, 0x100000, 30)

// Interface Frame MJPEG Descriptor ( 2048x1536 30fps )
MJPEG_FRAME_DESC(0x10, 2048, 1536, 0x100000, 30)

// Interface Frame MJPEG Descriptor ( 2592x1944 30fps )
MJPEG_FRAME_DESC(0x11, 2592, 1944, 0x100000, 30)

#elif (USB_UVC_1080P_MJPEG_EN)
// Interface Frame MJPEG Descriptor ( 1920x1080 30fps )
MJPEG_FRAME_DESC(0x0E, 1920, 1080, 0x100000, 30)

#endif
#endif//end of (CUSTOMER == ASU)

#if (USING_STILL_METHOD_1 == 0)
//Interface Still Image Frame Descriptor
MJPEG_STILL_DESC(USB_UVC_MJPEG_STILL_DESC_SIZE, NUM_MJPG_STILL, \
                 RES_LE(1280, 720), RES_LE(640,480), RES_LE(640,360), RES_LE(320,240), RES_LE(320,180), RES_LE(160,120), RES_LE(160,90))
#endif

// Interface Color Format
COLOR_DESC(1,1,4)

#endif //ENABLE_MJPEG



#if (SWAP_VIDEO_FORMAT_INDEX)  // YUY2 index is 1, MJPEG index is 2

#if ENABLE_YUY2
// Interface Format Uncompressed Descriptor
// 32595559-0000-0010-8000-00AA00389B71  'YUY2' == MEDIASUBTYPE_YUY2
YUY2_FORMAT_DESC(YUY2_FORMAT_INDEX, NUM_D1_YUY2_VIDEO)


// Interface Frame Uncompressed Descriptor ( 640x480 30fps )
YUY2_FRAME_DESC(0x01, 640, 480, 30)

// Interface Frame Uncompressed Descriptor ( 160x120 30fps )
YUY2_FRAME_DESC(0x02, 160, 120, 30)

// Interface Frame Uncompressed Descriptor ( 320x240 30fps )
YUY2_FRAME_DESC(0x03, 320, 240, 30)

// Interface Frame Uncompressed Descriptor ( 640x360 30fps )
YUY2_FRAME_DESC(0x04, 640, 360, 30)

// Interface Frame Uncompressed Descriptor ( 384x216 30fps )
YUY2_FRAME_DESC(0x05, 384, 216, 30)

// Interface Frame Uncompressed Descriptor ( 352x288 30fps )
YUY2_FRAME_DESC(0x06, 352, 288, 30)

// Interface Frame Uncompressed Descriptor ( 1280x720 30fps )
YUY2_FRAME_DESC(0x07, 1280, 720, 30)

// Interface Frame Uncompressed Descriptor ( 960x720 30fps )
YUY2_FRAME_DESC(0x08, 960, 720, 30)

// Interface Frame Uncompressed Descriptor ( 272x144 30fps )
YUY2_FRAME_DESC(0x09, 272, 144, 30)

// Interface Frame Uncompressed Descriptor ( 368x208 30fps )
YUY2_FRAME_DESC(0x0A, 368, 208, 30)

// Interface Frame Uncompressed Descriptor ( 480x272 30fps )
YUY2_FRAME_DESC(0x0B, 480, 272, 30)

// Interface Frame Uncompressed Descriptor ( 624x352 30fps )
YUY2_FRAME_DESC(0x0C, 624, 352, 30)

// Interface Frame Uncompressed Descriptor ( 912x512 30fps )
YUY2_FRAME_DESC(0x0D, 912, 512, 30)

// Interface Frame Uncompressed Descriptor ( 800x448 30fps )
YUY2_FRAME_DESC(0x0E, 800, 448, 30)

// Interface Frame Uncompressed Descriptor ( 800x600 30fps )
YUY2_FRAME_DESC(0x0F, 800, 600, 30)

// Interface Frame Uncompressed Descriptor ( 960x544 30fps )
YUY2_FRAME_DESC(0x10, 960, 544, 30)

// Interface Frame Uncompressed Descriptor ( 160x90 30fps )
YUY2_FRAME_DESC(0x11, 160, 90, 30)

// Interface Frame Uncompressed Descriptor ( 320x180 30fps )
YUY2_FRAME_DESC(0x12, 320, 180, 30)

#if USB_UVC_1080P_EN
// Interface Frame Uncompressed Descriptor ( 1920x1080 30fps )
YUY2_FRAME_DESC(0x13, 1920, 1080, 30)
#endif

#if (USING_STILL_METHOD_1 == 0)
//Interface Still Image Frame Descriptor
YUY2_STILL_DESC(USB_UVC_YUY2_STILL_DESC_SIZE, NUM_YUY2_STILL, 640, 640>>8, 480, 480>>8, 320, 320>>8, 240, 240>>8, 160, 160>>8, 120, 120>>8)
#endif

// Interface Color Format
COLOR_DESC(1,1,4)

#endif	//ENABLE_YUY2

#endif  //  #if (SWAP_VIDEO_FORMAT_INDEX)


#if ENABLE_FRAME_BASE_H264
// Interface Format Uncompressed Descriptor
// 31544941-0000-0010-8000-00AA00389B71  'AIT1' == MEDIASUBTYPE_AIT1
// 0x34363248,0x0000,0x0010,0x80,0x00,0x00,0xAA,0x00,0x38,0x9B,0x71 //FOURCC H264
H264_FORMAT_DESC(FRAME_BASE_H264_INDEX, NUM_H264_VIDEO)

// Interface Frame Uncompressed Descriptor ( 1280x720 30fps )
H264_FRAME_DESC(1, 1280, 720, 30)

// Interface Frame Uncompressed Descriptor ( 640x480 30fps )
H264_FRAME_DESC(2, 640, 480, 30)

// Interface Frame Uncompressed Descriptor ( 320x240 30fps )
H264_FRAME_DESC(3, 320, 240, 30)

// Interface Frame Uncompressed Descriptor ( 160x120 30fps )
H264_FRAME_DESC(4, 160, 120, 30)

// Interface Frame Uncompressed Descriptor ( 160x90 30fps )
H264_FRAME_DESC(5, 160, 90, 30)

// Interface Frame Uncompressed Descriptor ( 320x180 30fps )
H264_FRAME_DESC(6, 320, 180, 30)

// Interface Frame Uncompressed Descriptor ( 640x360 30fps )
H264_FRAME_DESC(7, 640, 360, 30)

// Interface Frame Uncompressed Descriptor ( 480x270 30fps )
H264_FRAME_DESC(8, 480, 270, 30)

// Interface Frame Uncompressed Descriptor ( 800x450 30fps )
H264_FRAME_DESC(9, 800, 450, 30)

// Interface Frame Uncompressed Descriptor ( 1024x576 30fps )
H264_FRAME_DESC(10, 1024, 576, 30)

#if USB_UVC_1080P_EN
// Interface Frame Uncompressed Descriptor ( 1920x1080 30fps )
H264_FRAME_DESC(11, 1920, 1080, 30)
#endif

// Interface Color Format
COLOR_DESC(1,1,4)

#endif //ENABLE_FRAME_BASE_H264



#if USB_UVC_BULK_EP
#else
// *******************************************************
// Interface Descriptor
USB_IF_UVC_STREAM_DESC_SIZE,
0x004,
UVC_D2_STREAM_IF1_NO,// interface
0x001,// alt.
0x001,// eps
0x00E,// class:video class
SC_VIDEOSTREAMING,// sub-class:video streaming
0x000,
0x000,
#endif

// Endpoint Descriptor
USB_EP_DESC_SIZE,// 
0x005,// endpoint descriptor type
//0x081,// EP1
(0x80|PCCAM_TX1_EP_ADDR),
#if USB_UVC_BULK_EP
0x002,// BULK
#else
0x005,// ISO
#endif
// MaxPkSize
LOBYTE(FS_TX_MAX_PK_SIZE),
HIBYTE(FS_TX_MAX_PK_SIZE),
// Interval
#if USB_UVC_BULK_EP
0x000,
#else
0x001,
#endif
#endif//SUPPORT_DUAL_DEVICE
#if SUPPORT_UAC

// *******************************************************
// Interface Association Descriptor
USB_IF_ASC_DESC_SIZE,
0x00B,
UAC_CTL_IF_NO,// first interface
NUM_OF_UAC_IF,// num of interface
0x001,// class:audio class
0x002,// sub-class:audio stream
0x000,
0x000,

// *******************************************************
// Interface Descriptor
USB_IF_UAC_CTL_DESC_SIZE,
0x004,
UAC_CTL_IF_NO,// interface
0x000,// alt.
0x000,
0x001,// class:audio class
0x001,// sub-class:audio control
0x000,
0x000,

// Interface Header Descriptor
USB_UAC_IF_CTL_HEADER_DESC_SIZE,
0x024,
0x001,// Header
0x000,// UAC Version 1.0 ( xp not support ver 2.0 )
0x001,
//0x026,// total size
//0x000,
LOBYTE(USB_UAC_IF_CTL_TOTAL_SIZE),      
HIBYTE(USB_UAC_IF_CTL_TOTAL_SIZE),      
0x001,// num of audio stream
UAC_STREAM_IF_NO,// interface of audio stream

// Interface Input Terminal Descriptor
USB_UAC_IF_CTL_IT_DESC_SIZE,
0x024,
0x002,// Input Terminal
0x001,// TID
0x001,// input type Microphone
0x002,
0x000,
AUDIN_CHANNEL,
#if AUDIN_CHANNEL==2
0x003,
#endif
#if AUDIN_CHANNEL==1
0x000,
#endif
0x000,
0x000,
0x000,

// Interface Output Terminal Descriptor
USB_UAC_IF_CTL_OT_DESC_SIZE,
0x024,
0x003,// Output Terminal
0x003,// TID
0x001,// output type streaming
0x001,
0x000,// assoc TID ( 0 or 1? )
0x005,// src ID
0x000,

// Interface Feature Unit Descriptor
USB_UAC_IF_CTL_FU_DESC_SIZE,
0x024,
0x006,// Feature Unit
0x005,// UID
0x001,// src ID
0x001,// num of control byte
0x003,// mute, volume
0x000,

// *******************************************************
// Interface Descriptor
USB_IF_UAC_STREAM_DESC_SIZE,
0x004,
UAC_STREAM_IF_NO,// interface
0x000,// alt.
0x000,
0x001,// class:audio class
0x002,// sub-class:audio streaming
0x000,
0x000,

// *******************************************************
// Interface Descriptor
USB_IF_UAC_STREAM_DESC_SIZE,
0x004,
UAC_STREAM_IF_NO,// interface
0x001,// alt.
0x001,// eps
0x001,// class:audio class
0x002,// sub-class:audio streaming
0x000,
0x000,

// Interface General Descriptor
USB_UAC_IF_STREAM_GENERAL_DESC_SIZE,
0x024,
0x001,// General
0x003,// endpoint link TID
0x002,//0x001,// delay ms ( num of frames )
0x001,// FormatTag, 1: PCM data format
0x000,

#if (CUSTOMER == LIT) || (CUSTOMER == LGT)
UAC_PCM_FORMAT_DESC(USB_UAC_IF_STREAM_FORMAT_PCM_DESC_SIZE,AUDIN_CHANNEL,2,16,NUM_OF_UAC_SAMPLING_RATE\
,LESBYTE(16000),LOSBYTE(16000),HISBYTE(16000)\
/*,LESBYTE(24000),LOSBYTE(24000),HISBYTE(24000)\*/
)
#elif ((CUSTOMER == CCN)&&(MODEL == 1))
UAC_PCM_FORMAT_DESC(USB_UAC_IF_STREAM_FORMAT_PCM_DESC_SIZE,AUDIN_CHANNEL,2,16,NUM_OF_UAC_SAMPLING_RATE\
,LESBYTE(16000),LOSBYTE(16000),HISBYTE(16000)\
/*,LESBYTE(24000),LOSBYTE(24000),HISBYTE(24000)\*/
,LESBYTE(8000),LOSBYTE(8000),HISBYTE(8000)\
/*,LESBYTE(48000),LOSBYTE(48000),HISBYTE(48000)\*/
)
#elif ((CUSTOMER == CCN)&&(MODEL == 0))// || (CUSTOMER == SNO)
UAC_PCM_FORMAT_DESC(USB_UAC_IF_STREAM_FORMAT_PCM_DESC_SIZE,AUDIN_CHANNEL,2,16,NUM_OF_UAC_SAMPLING_RATE\
,LESBYTE(16000),LOSBYTE(16000),HISBYTE(16000)\
/*,LESBYTE(24000),LOSBYTE(24000),HISBYTE(24000)\*/
,LESBYTE(8000),LOSBYTE(8000),HISBYTE(8000)\
/*,LESBYTE(48000),LOSBYTE(48000),HISBYTE(48000)\*/
)
#elif (CUSTOMER == ANW)
UAC_PCM_FORMAT_DESC(USB_UAC_IF_STREAM_FORMAT_PCM_DESC_SIZE,AUDIN_CHANNEL,2,16,NUM_OF_UAC_SAMPLING_RATE\
,LESBYTE(16000),LOSBYTE(16000),HISBYTE(16000)\
,LESBYTE(8000),LOSBYTE(8000),HISBYTE(8000)\
)
#else
UAC_PCM_FORMAT_DESC(USB_UAC_IF_STREAM_FORMAT_PCM_DESC_SIZE,AUDIN_CHANNEL,2,16,NUM_OF_UAC_SAMPLING_RATE\
,LESBYTE(AUDIN_SAMPLERATE),LOSBYTE(AUDIN_SAMPLERATE),HISBYTE(AUDIN_SAMPLERATE)\
)
#endif

// Endpoint Descriptor
USB_UAC_EP_DESC_SIZE,
0x005,
//0x082,// EP2
(0x80 | PCCAM_AU_EP_ADDR),
#if (UAC_SYNC_MODE_EN == 1)
0x0D,	// iso + sync
#else
0x005,// ISO + async
#endif
//AUDIO_PACKET_SIZE(AUDIN_SAMPLERATE,AUDIN_CHANNEL),
(AU_EP_MAX_PK_SIZE_FS & 0xFF),
(AU_EP_MAX_PK_SIZE_FS >> 8),
0x004,// 4 packets per frame
0x000,
0x000,

// Endpoint General Descriptor
USB_UAC_EP_GENERAL_DESC_SIZE,
0x025,
0x001,// General
0x001,// pitch control
0x000,
0x000,
0x000,
#endif  // end of #if SUPPORT_UAC
#if SUPPORT_HID_FUNC
/* New Interface descriptor */
0x09,
0x04,
#if SUPPORT_UAC
0x04,
#else
0x02,
#endif
0x00,
0x01,
0x03,
0x01,
0x01,//0x00:None , keyboard:0x01, mouse:0x02, 
0x00,

/* HID descriptor */
0x09,
0x21,
0x01,
0x01,
0x00,
0x01,
0x22,
(REPORT_DESCRIPTOR_LEN & 0xFF),
((REPORT_DESCRIPTOR_LEN >> 8) & 0xFF),

/* endpoint descriptor */
0x07,
0x05,
0x80|HID_EP_ADDR,
0x03,
HID_MAX_PK_SIZE,
0x05,
0x00,
#endif  // end of #if SUPPORT_HID_FUNC

};

MMP_UBYTE   LANGUAGE_ID_DATA[0x04] =
{
0x004, 0x003, 0x009, 0x004
};  

#if (CUSTOMER == NMG)

MMP_UBYTE   MANUFACTURER_STRING_DATA[] =
{
0x006,//0x01E,
0x003,
'H',0x00,
'P',0x00,
};

MMP_UBYTE   PRODUCT_STRING_DATA[] =
{
0x024,//0x01E,
0x003,
'H',0x00,
'P',0x00,
' ',0x00,
'W',0x00,
'e',0x00,
'b',0x00,
'c',0x00,
'a',0x00,
'm',0x00,
' ',0x00,
'H',0x00,
'D',0x00,
' ',0x00,
'5',0x00,
'2',0x00,
'1',0x00,
'0',0x00,
};         

#elif (CUSTOMER == NKT)

MMP_UBYTE   MANUFACTURER_STRING_DATA[] =
{
0x00E,//0x01E,
0x003,
'N',0x00,
'A',0x00,
'M',0x00,
'U',0x00,
'G',0x00,
'A',0x00,
};

MMP_UBYTE   PRODUCT_STRING_DATA[] =
{
0x01C,//0x01E,
0x003,
'N',0x00,
'a',0x00,
'm',0x00,
'u',0x00,
'g',0x00,
'a',0x00,
' ',0x00,
'C',0x00,
'a',0x00,
'm',0x00,
'e',0x00,
'r',0x00,
'a',0x00,
};         

#elif (CUSTOMER == LIT)

MMP_UBYTE   MANUFACTURER_STRING_DATA[] =
{
0x008,
0x003,
'L',0x00,
'G',0x00,
'E',0x00,
};

MMP_UBYTE   PRODUCT_STRING_DATA[] =
{
0x020,
0x003,
'A',0x00,
'N',0x00,
'-',0x00,
'V',0x00,
'C',0x00,
'4',0x00,
'0',0x00,
'0',0x00,
' ',0x00,
'C',0x00,
'a',0x00,
'm',0x00,
'e',0x00,
'r',0x00,
'a',0x00,
};         
/*
#elif ((CUSTOMER == CCN) && (MODEL == 0))

MMP_UBYTE   MANUFACTURER_STRING_DATA[] =
{
0x01C,
0x003,
'T',0x00,
'O',0x00,
'S',0x00,
'H',0x00,
'I',0x00,
'B',0x00,
'A',0x00,
' ',0x00,
'C',0x00,
'O',0x00,
'R',0x00,
'P',0x00,
'.',0x00,
};

MMP_UBYTE   PRODUCT_STRING_DATA[] =
{
0x024,
0x003,
'T',0x00,
'O',0x00,
'S',0x00,
'H',0x00,
'I',0x00,
'B',0x00,
'A',0x00,
' ',0x00,
'H',0x00,
'D',0x00,
' ',0x00,
'W',0x00,
'E',0x00,
'B',0x00,
'C',0x00,
'A',0x00,
'M',0x00,
};         
*/
#elif ((CUSTOMER == CCN) && (MODEL == 2))

MMP_UBYTE   MANUFACTURER_STRING_DATA[] =
{
0x03C,//0x01E,
0x003,
'C',0x00,
'h',0x00,
'i',0x00,
'c',0x00,
'o',0x00,
'n',0x00,
'y',0x00,
' ',0x00,
'E',0x00,
'l',0x00,
'e',0x00,
'c',0x00,
't',0x00,
'r',0x00,
'o',0x00,
'n',0x00,
'i',0x00,
'c',0x00,
's',0x00,
' ',0x00,
'C',0x00,
'o',0x00,
'.',0x00,
',',0x00,
' ',0x00,
'L',0x00,
't',0x00,
'd',0x00,
'.',0x00
};

MMP_UBYTE   PRODUCT_STRING_DATA[] =
{
0x02E,//0x01E,
0x003,
'I',0x00,
'n',0x00,
't',0x00,
'e',0x00,
'g',0x00,
'r',0x00,
'a',0x00,
't',0x00,
'e',0x00,
'd',0x00,
' ',0x00,
'R',0x00,
'e',0x00,
'a',0x00,
'r',0x00,
' ',0x00,
'C',0x00,
'a',0x00,
'm',0x00,
'e',0x00,
'r',0x00,
'a',0x00,
};         

#elif (CUSTOMER == LON)

MMP_UBYTE   MANUFACTURER_STRING_DATA[] =
{
0x034,//0x01E,
0x003,
'A',0x00,
'l',0x00,
'p',0x00,
'h',0x00,
'a',0x00,
' ',0x00,
'I',0x00,
'm',0x00,
'a',0x00,
'g',0x00,
'i',0x00,
'n',0x00,
'g',0x00,
' ',0x00,
'T',0x00,
'e',0x00,
'c',0x00,
'h',0x00,
'.',0x00,
' ',0x00,
'C',0x00,
'o',0x00,
'r',0x00,
'p',0x00,
'.',0x00
};

MMP_UBYTE   PRODUCT_STRING_DATA[] =
{
0x024,//0x01E,
0x003,
'I',0x00,
'n',0x00,
't',0x00,
'e',0x00,
'g',0x00,
'r',0x00,
'a',0x00,
't',0x00,
'e',0x00,
'd',0x00,
' ',0x00,
'W',0x00,
'e',0x00,
'b',0x00,
'c',0x00,
'a',0x00,
'm',0x00,
};         
#elif (CUSTOMER == ASU)
MMP_UBYTE   MANUFACTURER_STRING_DATA[] =
{
0x034,//0x01E,
0x003,
'A',0x00,
'l',0x00,
'p',0x00,
'h',0x00,
'a',0x00,
' ',0x00,
'I',0x00,
'm',0x00,
'a',0x00,
'g',0x00,
'i',0x00,
'n',0x00,
'g',0x00,
' ',0x00,
'T',0x00,
'e',0x00,
'c',0x00,
'h',0x00,
'.',0x00,
' ',0x00,
'C',0x00,
'o',0x00,
'r',0x00,
'p',0x00,
'.',0x00
};

#if (SUPPORT_DUAL_DEVICE||SUPPORT_SWITCH_CAMERA)
MMP_UBYTE   PRODUCT_STRING_DATA[] =
{
0x02E,
0x003,
'A',0x00,
'S',0x00,
'U',0x00,
'S',0x00,
' ',0x00,
'U',0x00,
'S',0x00,
'B',0x00,
' ',0x00,
'2',0x00,
'.',0x00,
'0',0x00,
' ',0x00,
'W',0x00,
'e',0x00,
'b',0x00,
'c',0x00,
'a',0x00,
'm',0x00,
' ',0x00,
'H',0x00,
'D',0x00,
};

MMP_UBYTE   PRODUCT_STRING2_DATA[] =
{
0x02E,
0x003,
'A',0x00,
'S',0x00,
'U',0x00,
'S',0x00,
' ',0x00,
'U',0x00,
'S',0x00,
'B',0x00,
' ',0x00,
'2',0x00,
'.',0x00,
'0',0x00,
' ',0x00,
'W',0x00,
'e',0x00,
'b',0x00,
'c',0x00,
'a',0x00,
'm',0x00,
' ',0x00,
'5',0x00,
'M',0x00,
};
#else
MMP_UBYTE   PRODUCT_STRING_DATA[] =
{
0x028,
0x003,
'A',0x00,
'S',0x00,
'U',0x00,
'S',0x00,
' ',0x00,
'U',0x00,
'S',0x00,
'B',0x00,
' ',0x00,
'2',0x00,
'.',0x00,
'0',0x00,
' ',0x00,
'W',0x00,
'e',0x00,
'b',0x00,
'c',0x00,
'a',0x00,
'm',0x00,
};
#endif
#elif (CUSTOMER == PNS)

MMP_UBYTE   MANUFACTURER_STRING_DATA[] =
{
0x034,//0x01E,
0x003,
'A',0x00,
'l',0x00,
'p',0x00,
'h',0x00,
'a',0x00,
' ',0x00,
'I',0x00,
'm',0x00,
'a',0x00,
'g',0x00,
'i',0x00,
'n',0x00,
'g',0x00,
' ',0x00,
'T',0x00,
'e',0x00,
'c',0x00,
'h',0x00,
'.',0x00,
' ',0x00,
'C',0x00,
'o',0x00,
'r',0x00,
'p',0x00,
'.',0x00
};

MMP_UBYTE   PRODUCT_STRING_DATA[] =
{
0x014,
0x003,
'U',0x00,
'S',0x00,
'B',0x00,
' ',0x00,
'H',0x00,
'D',0x00,
'C',0x00,
'A',0x00,
'M',0x00
};
#else

MMP_UBYTE   MANUFACTURER_STRING_DATA[] =
{
0x032,//0x034,
0x003,
'Z',0x00,
'h',0x00,
'o',0x00,
'n',0x00,
'g',0x00,
'd',0x00,
'a',0x00,
' ',0x00,
'M',0x00,
'i',0x00,
'c',0x00,
'r',0x00,
'o',0x00,
'e',0x00,
'l',0x00,
'e',0x00,
'c',0x00,
't',0x00,
'r',0x00,
'o',0x00,
'n',0x00,
'i',0x00,
'c',0x00,
's',0x00,
};

MMP_UBYTE   PRODUCT_STRING_DATA[] =
{
0x02A,//0x01E,
0x003,
'U',0x00,
'S',0x00,
'B',0x00,
'2',0x00,
'.',0x00,
'0',0x00,
' ',0x00,
'U',0x00,
'V',0x00,
'C',0x00,
' ',0x00,
'2',0x00,
'D',0x00,
'B',0x00,
'A',0x00,
'R',0x00,
'C',0x00,
'O',0x00,
'D',0x00,
'E',0x00
};         
#endif

#if (CUSTOMER == LIT)
MMP_UBYTE   SERIALNUMBER_STRING_DATA[] =
{
0x0a,
0x03,
'0',
0x00,
'3',
0x00,
'0',
0x00,
'2',
0x00,
};         
#else
MMP_UBYTE   SERIALNUMBER_STRING_DATA[] =
{
0x1a,
0x03,
'0',
0x00,
'0',
0x00,
'0',
0x00,
'0',
0x00,
'0',
0x00,
'0',
0x00,
'0',
0x00,
'0',
0x00,
'0',
0x00,
'0',
0x00,
'0',
0x00,
'0',
0x00,
};         
#endif

#if SUPPORT_HID_FUNC
#if 0
//report descriptor for mouse, size:0x3E
MMP_UBYTE   HID_REPORT_DSCR_DATA[REPORT_DESCRIPTOR_LEN] =
{
0x05, 0x01,
0x09, 0x02,
0xA1, 0x01,
0x05, 0x09,
0x19, 0x01,
0x29, 0x03,
0x15, 0x00,
0x25, 0x01,
0x95, 0x03,
0x75, 0x01,
0x81, 0x02,
0x95, 0x01,
0x75, 0x05,
0x81, 0x03,
0x05, 0x01,
0x09, 0x01,
0xA1, 0x00,
0x09, 0x30,
0x09, 0x31,
0x15, 0x81,
0x25, 0x7F,
0x75, 0x08,
0x95, 0x02,
0x81, 0x06,
0xC0, 
0x09, 0x38, 
0x15, 0x81, 
0x25, 0x7F, 
0x75, 0x08, 
0x95, 0x01, 
0x81, 0x06, 
0xC0,

};
#else
//report descriptor for keyboard, size:0x3F
MMP_UBYTE   HID_REPORT_DSCR_DATA[REPORT_DESCRIPTOR_LEN] =
{

0x05, 0x01,
0x09, 0x06,
0xA1, 0x01,
//Modifier byte 
0x05, 0x07,
0x19, 0xE0,
0x29, 0xE7,
0x15, 0x00,
0x25, 0x01,
0x75, 0x01,
0x95, 0x08,
0x81, 0x02,
//reserve key
0x95, 0x01,
0x75, 0x08,
0x81, 0x01,
//LED
/*
0x95, 0x05,
0x75, 0x01,
0x05, 0x08,
0x19, 0x01,
0x29, 0x05,
0x91, 0x02,
0x95, 0x01,
0x75, 0x03,
0x91, 0x01,
*/
//the rest 6 bytes for keycode
0x95, 0x06,
0x75, 0x08,
0x15, 0x00, 
0x25, 0x65,
0x05, 0x07,
0x19, 0x00,
0x29, 0x65,
0x81, 0x00,
//end
0xC0,
};
#endif
#endif  // end of #if SUPPORT_HID_FUNC

#endif  //#if   defined(USB_FW)

/// @}
